Showing posts with label following. Show all posts
Showing posts with label following. Show all posts

Thursday, March 29, 2012

html image percentage issue

I am unable display an image by percent. No matter what method I try,
I receive the following error.

Input string was not in the correct format.

No matter what method I use, I cannot get this to show up in a percent
format. What am I missing here.

currentStatusImage.Src = "../builds/images/green.gif"
currentStatusImage.Width = "60%"

Thanks.currentStatusImage.Width is expecting a Unit, not a string, so you need to
do a Unit.Parse("60%") or a Unit.Percentage(60).

HTH,

Bill Priess

On 23 Jul 2003 13:29:33 -0700, Chris <chrisp@.webpositive.com> wrote:

> I am unable display an image by percent. No matter what method I try,
> I receive the following error.
> Input string was not in the correct format.
> No matter what method I use, I cannot get this to show up in a percent
> format. What am I missing here.
> currentStatusImage.Src = "../builds/images/green.gif"
> currentStatusImage.Width = "60%"
> Thanks.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
I get an error stating that unit cannot convert to an integer, on both of
those attempts.

"Bill Priess" <no.spam@.nospam.com> wrote in message
news:oprsr572hkcimqky@.localhost...
> currentStatusImage.Width is expecting a Unit, not a string, so you need to
> do a Unit.Parse("60%") or a Unit.Percentage(60).
> HTH,
> Bill Priess
> On 23 Jul 2003 13:29:33 -0700, Chris <chrisp@.webpositive.com> wrote:
> > I am unable display an image by percent. No matter what method I try,
> > I receive the following error.
> > Input string was not in the correct format.
> > No matter what method I use, I cannot get this to show up in a percent
> > format. What am I missing here.
> > currentStatusImage.Src = "../builds/images/green.gif"
> > currentStatusImage.Width = "60%"
> > Thanks.
>
> --
> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
From the documentation:

HtmlImage.Width Property

Gets or sets the width of the image.

Public Property Width As Integer

Property Value

The width of the image.

--
John Saunders
Internet Engineer
john.saunders@.surfcontrol.com

"Chris" <chrisp@.webpositive.com> wrote in message
news:1058997574.400832@.sj-nntpcache-5...
> I get an error stating that unit cannot convert to an integer, on both of
> those attempts.
>
> "Bill Priess" <no.spam@.nospam.com> wrote in message
> news:oprsr572hkcimqky@.localhost...
> > currentStatusImage.Width is expecting a Unit, not a string, so you need
to
> > do a Unit.Parse("60%") or a Unit.Percentage(60).
> > HTH,
> > Bill Priess
> > On 23 Jul 2003 13:29:33 -0700, Chris <chrisp@.webpositive.com> wrote:
> > > I am unable display an image by percent. No matter what method I try,
> > > I receive the following error.
> > > > Input string was not in the correct format.
> > > > No matter what method I use, I cannot get this to show up in a percent
> > > format. What am I missing here.
> > > > currentStatusImage.Src = "../builds/images/green.gif"
> > > currentStatusImage.Width = "60%"
> > > > Thanks.
> > > --
> > Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
It does, the sdk also states that you can also set the value as a
percentage. The problem is that it doesn't give an example or any
detail to that.

"By default, the Width property is expressed in pixels, but it can
also be expressed as a percentage of the window size." - straight from
the windows sdk, and that's all it has to say about it. But how??

http://msdn.microsoft.com/library/d...idthtop ic.asp

"John Saunders" <john.saunders@.surfcontrol.com> wrote in message news:<Ouy$DqWUDHA.2308@.TK2MSFTNGP12.phx.gbl>...
> From the documentation:
> HtmlImage.Width Property
> Gets or sets the width of the image.
> Public Property Width As Integer
> Property Value
> The width of the image.
> --
> John Saunders
> Internet Engineer
> john.saunders@.surfcontrol.com
>
> "Chris" <chrisp@.webpositive.com> wrote in message
> news:1058997574.400832@.sj-nntpcache-5...
> > I get an error stating that unit cannot convert to an integer, on both of
> > those attempts.
> > "Bill Priess" <no.spam@.nospam.com> wrote in message
> > news:oprsr572hkcimqky@.localhost...
> > > currentStatusImage.Width is expecting a Unit, not a string, so you need
> to
> > > do a Unit.Parse("60%") or a Unit.Percentage(60).
> > > > HTH,
> > > > Bill Priess
> > > > On 23 Jul 2003 13:29:33 -0700, Chris <chrisp@.webpositive.com> wrote:
> > > > > I am unable display an image by percent. No matter what method I try,
> > > > I receive the following error.
> > > > > > Input string was not in the correct format.
> > > > > > No matter what method I use, I cannot get this to show up in a percent
> > > > format. What am I missing here.
> > > > > > currentStatusImage.Src = "../builds/images/green.gif"
> > > > currentStatusImage.Width = "60%"
> > > > > > Thanks.
> > > > > > > > --
> > > Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
It seems you've found a documentation error.

An integer is an integer, not a Unit. You can't use percentage in an
HtmlImage.

John Saunders
john.saunders@.surfcontrol.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
It seems you've found a documentation error.

An integer is an integer, not a Unit. You can't use percentage in an
HtmlImage.

John Saunders
john.saunders@.surfcontrol.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Any ideas on how to get around this. In addition to this being an issue,
when I attempt to do the following ( going back to my asp classic way of
thinking ) :

<img border="0" id="currentStatusImage" src="http://pics.10026.com/?src=<% = srcInfo %> width="<% =
widthInfo %>%" height="6" runat="server"
I still get the integer error. I'd rather not make this a static image but,
the list of ideas grows smaller. Thanks.

"John Saunders" <john.saunders@.surfcontrol.com> wrote in message
news:e5PAL8dUDHA.1484@.TK2MSFTNGP12.phx.gbl...
> It seems you've found a documentation error.
> An integer is an integer, not a Unit. You can't use percentage in an
> HtmlImage.
> John Saunders
> john.saunders@.surfcontrol.com
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
You're still getting the error because you've still got the control marked
as runat="server", which means it's an HtmlImage, which means that the Width
property is an integer.

Do you really need the image to be a server control?

And why not use style="WIDTH:100%" :

currentStatusImage.Style["WIDTH"] = "100%"

--
John Saunders
Internet Engineer
john.saunders@.surfcontrol.com

"Chris" <chrisp@.webpositive.com> wrote in message
news:1059061676.370476@.sj-nntpcache-3...
> Any ideas on how to get around this. In addition to this being an issue,
> when I attempt to do the following ( going back to my asp classic way of
> thinking ) :
> <img border="0" id="currentStatusImage" src="http://pics.10026.com/?src=<% = srcInfo %> width="<% =
> widthInfo %>%" height="6" runat="server">
> I still get the integer error. I'd rather not make this a static image
but,
> the list of ideas grows smaller. Thanks.
>
> "John Saunders" <john.saunders@.surfcontrol.com> wrote in message
> news:e5PAL8dUDHA.1484@.TK2MSFTNGP12.phx.gbl...
> > It seems you've found a documentation error.
> > An integer is an integer, not a Unit. You can't use percentage in an
> > HtmlImage.
> > John Saunders
> > john.saunders@.surfcontrol.com
> > *** Sent via Developersdex http://www.developersdex.com ***
> > Don't just participate in USENET...get rewarded for it!

Html Help

I'm havinf a problem with the following form tag, as for some reason it doesn't allow me to go to a different page


<%@dotnet.itags.org. Page Language="C#" %>
<html>
<head>
<title>My Page</title>
</head>
<body>
<form runat="server">
<form method="POST" action="http://www.microsoft.com">
<input type="submit" value="15" name="redirect" />
</form>
</form>
</body>
</html>

Can anyone figure why?Hi,
Place HTML <form> outside the Server side <form> :


<%@. Page Language="C#" %>
<html>
<head>
<title>My Page</title>
</head
<body>
<form runat="server">
</form>

<form method="POST" action="http://www.microsoft.com">
<input type="submit" value="15" name="redirect" />
</form>
</body>
</html>

Take a look @. :
-Form-based Programming in ASP.NET
-Wilson WebForm enables Multiple Forms and Non-PostBack Forms

HTH
thanks for that, is it possible to do the same thing within a user control, coz this is where my problem occurs?

HTML Generation from XML

Hi!
I have a XMl and a XSL file. And i am generating HTML file using the XXML
and XSL file using the following code
Dim xslt As New XslTransform
Dim mydata As New XmlDocument
mydata.Load("PrintId.xml")
xslt.Load("PrintID.xslt")
Dim writer As XmlTextWriter = New
XmlTextWriter("C:\Inetpub\wwwroot\VBPDFDemo\PrintID15.html", Nothing)
xslt.Transform(mydata, Nothing, writer, Nothing)
xslt = Nothing
mydata = Nothing
writer = Nothing
The code excutes fine, But it's taking a ot of time to generate the HTML.
and the process continues even if I closed my browser and generates the file
.
How do i solve the problem. how do i minimize the time?
Can anyone help me out
Thanks in advance
Baren

HTML Generation from XML

Hi!

I have a XMl and a XSL file. And i am generating HTML file using the XXML
and XSL file using the following code
Dim xslt As New XslTransform
Dim mydata As New XmlDocument
mydata.Load("PrintId.xml")
xslt.Load("PrintID.xslt")
Dim writer As XmlTextWriter = New
XmlTextWriter("C:\Inetpub\wwwroot\VBPDFDemo\PrintID15.html", Nothing)
xslt.Transform(mydata, Nothing, writer, Nothing)
xslt = Nothing
mydata = Nothing
writer = Nothing

The code excutes fine, But it's taking a ot of time to generate the HTML.
and the process continues even if I closed my browser and generates the file.
How do i solve the problem. how do i minimize the time?

Can anyone help me out

Thanks in advance

Baren

HTML Generation from XML

Hi!

I have a XMl and a XSL file. And i am generating HTML file using the XXML
and XSL file using the following code
Dim xslt As New XslTransform
Dim mydata As New XmlDocument
mydata.Load("PrintId.xml")
xslt.Load("PrintID.xslt")
Dim writer As XmlTextWriter = New
XmlTextWriter("C:\Inetpub\wwwroot\VBPDFDemo\PrintID15.html", Nothing)
xslt.Transform(mydata, Nothing, writer, Nothing)
xslt = Nothing
mydata = Nothing
writer = Nothing

The code excutes fine, But it's taking a ot of time to generate the HTML.
and the process continues even if I closed my browser and generates the file.

Can anyone help me out

Thanks in advance

Baren

Monday, March 26, 2012

Html formatted email

Can anyone advise me on how to amend the following code to send Html formatted emails? It works perfectly in normal text format - I am a novice programmer.

<%@dotnet.itags.org.PageExplicit="true"Language="VB"Debug="True" %>

<html>

<head>

</head>

<body>

<%

Dim EMailFromAsString = Session("eMailFrom")

Dim EMailToAsString = Request.Form("txtTo")

Dim EMailSubjectAsString ="Your Report"

Dim EMailBodyAsString = Request.Form("txtNewBody")

Dim MySmtpClientAsNew System.Net.Mail.SmtpClient

MySmtpClient.Send(EMailFrom, EMailTo, EMailSubject, EMailBody)%>

Any help appreciated

Anything and everything email and .NET related can be found at:

If you are dealing with 1.1:
http://www.systemwebmail.com

Or 2.0 framework
http://www.systemnetmail.com

Both sites have working examples, diagnostic solutions, and setup


I put together a FAQ in the FAQ Forum:HOW TO: Send using System.Net.Mail

HTH,
Ryan

HTML first, Page_Load later

In the following aspx file the output from Page_Load code is rendered first
and HTML later. I want the other way round.
How can I do that?
<%@dotnet.itags.org. Page Language="C#" %>
<%@dotnet.itags.org. Import Namespace="System.IO" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"><title>Welcome to my Project</title></head>
<body>
<form id="form1" runat="server"><div>
<h3>Below are the files in my Project</h3>
</div></form>
</body></html>
<script runat="server">
protected void Page_Load(object sender, EventArgs e) {
DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));
foreach (FileInfo f in dir.GetFiles("*.as*x"))
if (f.Name.ToLower() != "default.aspx") Response.Write("<a href='./" +
f.Name + "'>" + f.Name + "</a>" + "<br>");
}
</script>Instead of doing raw Response.Write's to the output stream, try databinding
your "stuff" to a control defined on the Page that is suitable for rendering
such a list - a Repeater, DataList, or Gridview.
Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"dotNET learner" wrote:

> In the following aspx file the output from Page_Load code is rendered firs
t
> and HTML later. I want the other way round.
> How can I do that?
>
> <%@. Page Language="C#" %>
> <%@. Import Namespace="System.IO" %>
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head runat="server"><title>Welcome to my Project</title></head>
> <body>
> <form id="form1" runat="server"><div>
> <h3>Below are the files in my Project</h3>
> </div></form>
> </body></html>
>
> <script runat="server">
> protected void Page_Load(object sender, EventArgs e) {
>
> DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));
> foreach (FileInfo f in dir.GetFiles("*.as*x"))
> if (f.Name.ToLower() != "default.aspx") Response.Write("<a href='./" +
> f.Name + "'>" + f.Name + "</a>" + "<br>");
> }
> </script>
>
>
On Mar 19, 4:07 pm, Peter Bromberg [C# MVP]
<pbromb...@.yahoo.yabbadabbadoo.com> wrote:
> Instead of doing raw Response.Write's to the output stream, try databindin
g
> your "stuff" to a control defined on the Page that is suitable for renderi
ng
> such a list - a Repeater, DataList, or Gridview.
> Peter
> --
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> Short urls & more: http://ittyurl.net
> "dotNET learner" wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
I would also suggest using code behind files instead of including the
C# logic in the ASPX page itself. This separates the code from the
design which is always a good direction to go.
Following your suggestion, I used simple Label control instead of
"Response.Write". It worked. Thank you :) The modified code is below:
protected void Page_Load(object sender, EventArgs e) {
string fileList = "";
DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));
foreach (FileInfo f in dir.GetFiles("*.as*x"))
if (f.Name.ToLower() != "default.aspx") {
fileList = fileList + "<a href='./" + f.Name + "'>" + f.Name + "</a>" +
"<br>";
}
lblFileList.Text = fileList;
}
"Peter Bromberg [C# MVP]" <pbromberg@.yahoo.yabbadabbadoo.com> wrote in
message news:5435FFC5-B40B-4AEB-8773-7E5C377AE71F@.microsoft.com...
> Instead of doing raw Response.Write's to the output stream, try
> databinding
> your "stuff" to a control defined on the Page that is suitable for
> rendering
> such a list - a Repeater, DataList, or Gridview.
> Peter
> --
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> Short urls & more: http://ittyurl.net
>
>
> "dotNET learner" wrote:
>

HTML first, Page_Load later

In the following aspx file the output from Page_Load code is rendered first
and HTML later. I want the other way round.

How can I do that?

<%@dotnet.itags.org. Page Language="C#" %>

<%@dotnet.itags.org. Import Namespace="System.IO" %>

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server"><title>Welcome to my Project</title></head>

<body>

<form id="form1" runat="server"><div>

<h3>Below are the files in my Project</h3>

</div></form>

</body></html>

<script runat="server">

protected void Page_Load(object sender, EventArgs e) {

DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));

foreach (FileInfo f in dir.GetFiles("*.as*x"))

if (f.Name.ToLower() != "default.aspx") Response.Write("<a href='http://links.10026.com/?link=./" +
f.Name + "'>" + f.Name + "</a>" + "<br>");

}

</script>Instead of doing raw Response.Write's to the output stream, try databinding
your "stuff" to a control defined on the Page that is suitable for rendering
such a list - a Repeater, DataList, or Gridview.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"dotNET learner" wrote:

Quote:

Originally Posted by

In the following aspx file the output from Page_Load code is rendered first
and HTML later. I want the other way round.
>
How can I do that?
>
>
>
<%@. Page Language="C#" %>
>
<%@. Import Namespace="System.IO" %>
>
<html xmlns="http://www.w3.org/1999/xhtml">
>
<head runat="server"><title>Welcome to my Project</title></head>
>
<body>
>
<form id="form1" runat="server"><div>
>
<h3>Below are the files in my Project</h3>
>
</div></form>
>
</body></html>
>
>
>
<script runat="server">
>
protected void Page_Load(object sender, EventArgs e) {
>
>
DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));
>
foreach (FileInfo f in dir.GetFiles("*.as*x"))
>
if (f.Name.ToLower() != "default.aspx") Response.Write("<a href='http://links.10026.com/?link=./" +
f.Name + "'>" + f.Name + "</a>" + "<br>");
>
}
>
</script>
>
>
>


On Mar 19, 4:07 pm, Peter Bromberg [C# MVP]
<pbromb...@.yahoo.yabbadabbadoo.comwrote:

Quote:

Originally Posted by

Instead of doing raw Response.Write's to the output stream, try databinding
your "stuff" to a control defined on the Page that is suitable for rendering
such a list - a Repeater, DataList, or Gridview.
Peter
>
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
>
"dotNET learner" wrote:

Quote:

Originally Posted by

In the following aspx file the output from Page_Load code is rendered first
and HTML later. I want the other way round.


>

Quote:

Originally Posted by

How can I do that?


>

Quote:

Originally Posted by

<%@. Page Language="C#" %>


>

Quote:

Originally Posted by

<%@. Import Namespace="System.IO" %>


>

Quote:

Originally Posted by

<html xmlns="http://www.w3.org/1999/xhtml">


>

Quote:

Originally Posted by

<head runat="server"><title>Welcome to my Project</title></head>


>

Quote:

Originally Posted by

<body>


>

Quote:

Originally Posted by

<form id="form1" runat="server"><div>


>

Quote:

Originally Posted by

<h3>Below are the files in my Project</h3>


>

Quote:

Originally Posted by

</div></form>


>

Quote:

Originally Posted by

</body></html>


>

Quote:

Originally Posted by

<script runat="server">


>

Quote:

Originally Posted by

protected void Page_Load(object sender, EventArgs e) {


>

Quote:

Originally Posted by

DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));


>

Quote:

Originally Posted by

foreach (FileInfo f in dir.GetFiles("*.as*x"))


>

Quote:

Originally Posted by

if (f.Name.ToLower() != "default.aspx") Response.Write("<a href='http://links.10026.com/?link=./" +
f.Name + "'>" + f.Name + "</a>" + "<br>");


>

Quote:

Originally Posted by

}


>

Quote:

Originally Posted by

</script>


I would also suggest using code behind files instead of including the
C# logic in the ASPX page itself. This separates the code from the
design which is always a good direction to go.
Following your suggestion, I used simple Label control instead of
"Response.Write". It worked. Thank you :) The modified code is below:

protected void Page_Load(object sender, EventArgs e) {
string fileList = "";

DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));

foreach (FileInfo f in dir.GetFiles("*.as*x"))

if (f.Name.ToLower() != "default.aspx") {

fileList = fileList + "<a href='http://links.10026.com/?link=./" + f.Name + "'>" + f.Name + "</a>" +
"<br>";

}

lblFileList.Text = fileList;

}

"Peter Bromberg [C# MVP]" <pbromberg@.yahoo.yabbadabbadoo.comwrote in
message news:5435FFC5-B40B-4AEB-8773-7E5C377AE71F@.microsoft.com...

Quote:

Originally Posted by

Instead of doing raw Response.Write's to the output stream, try
databinding
your "stuff" to a control defined on the Page that is suitable for
rendering
such a list - a Repeater, DataList, or Gridview.
Peter
>
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
>
>
>
>
"dotNET learner" wrote:
>

Quote:

Originally Posted by

>In the following aspx file the output from Page_Load code is rendered
>first
>and HTML later. I want the other way round.
>>
> How can I do that?
>>
>>
>>
><%@. Page Language="C#" %>
>>
><%@. Import Namespace="System.IO" %>
>>
><html xmlns="http://www.w3.org/1999/xhtml">
>>
><head runat="server"><title>Welcome to my Project</title></head>
>>
><body>
>>
><form id="form1" runat="server"><div>
>>
><h3>Below are the files in my Project</h3>
>>
></div></form>
>>
></body></html>
>>
>>
>>
><script runat="server">
>>
> protected void Page_Load(object sender, EventArgs e) {
>>
>>
> DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));
>>
> foreach (FileInfo f in dir.GetFiles("*.as*x"))
>>
> if (f.Name.ToLower() != "default.aspx") Response.Write("<a href='http://links.10026.com/?link=./" +
>f.Name + "'>" + f.Name + "</a>" + "<br>");
>>
>}
>>
></script>
>>
>>
>>

Thursday, March 22, 2012

HTML control value to an ASP.NET value

Hi. I have the following HTML Control and I want to access the value in my asp.net code.

<INPUT ID="hdnFPrintNA" runat=server STYLE="Z-INDEX: 163; LEFT: 165px; WIDTH: 38px; POSITION: absolute; TOP: 5px; HEIGHT: 22px" TYPE="hidden" SIZE="1">
--------------
When the user presses my Server control button to clear the screen, I would like to clear the hidden text field as well. The below doesn't work.

Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click

hdnFPrintNA.Text = ""

End Sub
-------------
I have been searching this site to try and find the answer but I am only getting confused. Can any one point me in the right direction and tell me how to solve this problem?

ThanksI think it should read

hdnFPrintNA.value =""
Try using "hdnFPrintNA.Value" instead. And also remember to define your Html Control as:

'System.Web.UI.HtmlControls.HtmlInputHidden'
Thank you both for your help. It works now. :)

Wednesday, March 21, 2012

HTML Client Control versus. HTML Server Control versus. Web Server Control

Personally, I am totally confused with the following control terms and usage
and advantages of each one in ASP.NET web application. Here's what I know so
far..

1. HTML Client Control: understood by the client only. e.g. <input
type="text" name="emp_name">
2. HTML Server Control: understood by the server only. e.g. <input
type="text" name="emp_name"
runat="server">
3. Web Server Control: understood by the server only. e.g. <asp:TextBox
id="emp_name"
runat="server"></asp:TextBox
I tried to use all, but yield the same output. I am sure there are
advantages of each one, please advise!
Thanks!The HTML controls (client controls) are the same HTML 4.01 controls that
have been part of the HTML language for a very long time. Use these when
their native client-side functionality serves your purpose (lowest overhead
with these controls).

The HTML Server controls are the same as above but with added server-side
programming/viewstate capabilities. Use these when migrating a "Classic
ASP" application to ASP.NET and you won't have to completely replace all
your old controls with new ones to get the .NET benefits of them. While you
do get some server-side programming capabilities with these, you don't get
the full range of properties, methods & events that pure server-side
controls offer.

The Web Form controls (a.k.a. Web Server controls) provide .NET native
server-side programming support. The properties, methods and events of
these controls are more VB like than the HTML controls. These controls
offer the widest range of flexibility from a programming standpoint, but can
(if not used correctly) create more overhead (viewstate) for your .aspx
pages.

The Web Form controls also feature controls that don't have an HTML
equivalent (validation controls, data controls, other rich controls
[calendar]). No matter which Web Form control you use, they render
themselves to the client as pure HTML/JavaScript, so they can be used in any
client!

-Scott

"Matthew Louden" <jrefactors@.hotmail.com> wrote in message
news:ezrMcGCkDHA.2616@.TK2MSFTNGP11.phx.gbl...
> Personally, I am totally confused with the following control terms and
usage
> and advantages of each one in ASP.NET web application. Here's what I know
so
> far..
> 1. HTML Client Control: understood by the client only. e.g. <input
> type="text" name="emp_name">
> 2. HTML Server Control: understood by the server only. e.g. <input
> type="text" name="emp_name"
> runat="server">
> 3. Web Server Control: understood by the server only. e.g. <asp:TextBox
> id="emp_name"
> runat="server"></asp:TextBox>
> I tried to use all, but yield the same output. I am sure there are
> advantages of each one, please advise!
> Thanks!
>
>

HTML Changing

Hello All,

I'm expereincing a strange problem using Visual Studio. In HTML view I have the following two lines of code. Every time I save the page the two "/" disappear. from the HTML. This then causes an error message when the page loads. I have tried various settings on the option tab to stop this from occuring but none seem to work.


<meta name="keywords" content="keys" ID="Keywords" runat="server"/>
<meta name="description" content="description" ID="Description" runat="server"/>
Which version of VS?

html at end of download - urgent please help!

hi there

i have the following bit of code that downloads/uploads documents from
a sql database.

the problem i have is when i download an image for example and look at
it in notepad i see the binary data and below it the html from the page
the image was downloaded from. so my 10k image is now 32k.

please any help would be much appreciated.

thanks

shawn

Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnUpload.Click
Dim iLength As Integer =
CType(LifeFileUpload.PostedFile.InputStream.Length , Integer)
If iLength = 0 Then Exit Sub 'not a valid file
Dim sContentType As String =
LifeFileUpload.PostedFile.ContentType
Dim sFileName As String, i As Integer
Dim bytContent As Byte()
ReDim bytContent(iLength)

'strip the path off the filename
i = InStrRev(LifeFileUpload.PostedFile.FileName.Trim, "\")
If i = 0 Then
sFileName = LifeFileUpload.PostedFile.FileName.Trim
Else
sFileName = Right(LifeFileUpload.PostedFile.FileName.Trim,
Len(LifeFileUpload.PostedFile.FileName.Trim) - i)
End If

LifeFileUpload.PostedFile.InputStream.Read(bytCont ent, 0,
iLength)

objDonkey.SelectedClient.AddDocument(objDonkey.Use rName,
sFileName, sContentType, iLength, bytContent, "this is a test
document")

End Sub

Protected Sub btnGetDoc_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnGetDoc.Click
Dim DocId As Integer
Dim objDoc As Life.Clients.Client.DocumentItem

DocId = HiddenSelectedDoc.Value
objDonkey.SelectedClient.GetDocuments()
objDoc = objDonkey.SelectedClient.DocumentList(DocId)

Response.Buffer = True
Response.Expires = -1
Response.ClearContent()
Response.ClearHeaders()

Response.ContentType = "image/jpeg" 'objDoc.ContentType

Response.OutputStream.Write(CType(objDonkey.Select edClient.GetDocument(DocId),
Byte()), 0, CInt(objDoc.ContentLegnth))
Response.AddHeader("Content-Disposition",
"attachment;filename=" + objDoc.Filename)
Response.Flush()

End SubHi Shawn,

Try to clear the response object after the following code:

Response.Buffer = True
Response.Expires = -1
Response.ClearContent()
Response.ClearHeaders()
// Clear the response object.
Response.Clear();

And then when you finished writing into the response stream:

Response.Flush();
Response.End();

I think it might help.

See ya.

Thiago Oliveira

shawn_vandenberg@.yahoo.com escreveu:

Quote:

Originally Posted by

hi there
>
i have the following bit of code that downloads/uploads documents from
a sql database.
>
the problem i have is when i download an image for example and look at
it in notepad i see the binary data and below it the html from the page
the image was downloaded from. so my 10k image is now 32k.
>
please any help would be much appreciated.
>
thanks
>
shawn
>
>
>
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnUpload.Click
Dim iLength As Integer =
CType(LifeFileUpload.PostedFile.InputStream.Length , Integer)
If iLength = 0 Then Exit Sub 'not a valid file
Dim sContentType As String =
LifeFileUpload.PostedFile.ContentType
Dim sFileName As String, i As Integer
Dim bytContent As Byte()
ReDim bytContent(iLength)
>
'strip the path off the filename
i = InStrRev(LifeFileUpload.PostedFile.FileName.Trim, "\")
If i = 0 Then
sFileName = LifeFileUpload.PostedFile.FileName.Trim
Else
sFileName = Right(LifeFileUpload.PostedFile.FileName.Trim,
Len(LifeFileUpload.PostedFile.FileName.Trim) - i)
End If
>
LifeFileUpload.PostedFile.InputStream.Read(bytCont ent, 0,
iLength)
>
objDonkey.SelectedClient.AddDocument(objDonkey.Use rName,
sFileName, sContentType, iLength, bytContent, "this is a test
document")
>
>
End Sub
>
Protected Sub btnGetDoc_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnGetDoc.Click
Dim DocId As Integer
Dim objDoc As Life.Clients.Client.DocumentItem
>
DocId = HiddenSelectedDoc.Value
objDonkey.SelectedClient.GetDocuments()
objDoc = objDonkey.SelectedClient.DocumentList(DocId)
>
>
Response.Buffer = True
Response.Expires = -1
Response.ClearContent()
Response.ClearHeaders()
>
Response.ContentType = "image/jpeg" 'objDoc.ContentType
>
Response.OutputStream.Write(CType(objDonkey.Select edClient.GetDocument(DocId),
Byte()), 0, CInt(objDoc.ContentLegnth))
Response.AddHeader("Content-Disposition",
"attachment;filename=" + objDoc.Filename)
Response.Flush()
>
>
End Sub

html at end of download - urgent please help!

hi there
i have the following bit of code that downloads/uploads documents from
a sql database.
the problem i have is when i download an image for example and look at
it in notepad i see the binary data and below it the html from the page
the image was downloaded from. so my 10k image is now 32k.
please any help would be much appreciated.
thanks
shawn
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnUpload.Click
Dim iLength As Integer =
CType(LifeFileUpload.PostedFile.InputStream.Length, Integer)
If iLength = 0 Then Exit Sub 'not a valid file
Dim sContentType As String =
LifeFileUpload.PostedFile.ContentType
Dim sFileName As String, i As Integer
Dim bytContent As Byte()
ReDim bytContent(iLength)
'strip the path off the filename
i = InStrRev(LifeFileUpload.PostedFile.FileName.Trim, "\")
If i = 0 Then
sFileName = LifeFileUpload.PostedFile.FileName.Trim
Else
sFileName = Right(LifeFileUpload.PostedFile.FileName.Trim,
Len(LifeFileUpload.PostedFile.FileName.Trim) - i)
End If
LifeFileUpload.PostedFile.InputStream.Read(bytContent, 0,
iLength)
objDonkey.SelectedClient.AddDocument(objDonkey.UserName,
sFileName, sContentType, iLength, bytContent, "this is a test
document")
End Sub
Protected Sub btnGetDoc_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnGetDoc.Click
Dim DocId As Integer
Dim objDoc As Life.Clients.Client.DocumentItem
DocId = HiddenSelectedDoc.Value
objDonkey.SelectedClient.GetDocuments()
objDoc = objDonkey.SelectedClient.DocumentList(DocId)
Response.Buffer = True
Response.Expires = -1
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "image/jpeg" 'objDoc.ContentType
Response.OutputStream.Write(CType(objDonkey.SelectedClient.GetDocument(DocId
),
Byte()), 0, CInt(objDoc.ContentLegnth))
Response.AddHeader("Content-Disposition",
"attachment;filename=" + objDoc.Filename)
Response.Flush()
End SubHi Shawn,
Try to clear the response object after the following code:
Response.Buffer = True
Response.Expires = -1
Response.ClearContent()
Response.ClearHeaders()
// Clear the response object.
Response.Clear();
And then when you finished writing into the response stream:
Response.Flush();
Response.End();
I think it might help.
See ya.
Thiago Oliveira
shawn_vandenberg@.yahoo.com escreveu:

> hi there
> i have the following bit of code that downloads/uploads documents from
> a sql database.
> the problem i have is when i download an image for example and look at
> it in notepad i see the binary data and below it the html from the page
> the image was downloaded from. so my 10k image is now 32k.
> please any help would be much appreciated.
> thanks
> shawn
>
> Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles btnUpload.Click
> Dim iLength As Integer =
> CType(LifeFileUpload.PostedFile.InputStream.Length, Integer)
> If iLength = 0 Then Exit Sub 'not a valid file
> Dim sContentType As String =
> LifeFileUpload.PostedFile.ContentType
> Dim sFileName As String, i As Integer
> Dim bytContent As Byte()
> ReDim bytContent(iLength)
> 'strip the path off the filename
> i = InStrRev(LifeFileUpload.PostedFile.FileName.Trim, "\")
> If i = 0 Then
> sFileName = LifeFileUpload.PostedFile.FileName.Trim
> Else
> sFileName = Right(LifeFileUpload.PostedFile.FileName.Trim,
> Len(LifeFileUpload.PostedFile.FileName.Trim) - i)
> End If
> LifeFileUpload.PostedFile.InputStream.Read(bytContent, 0,
> iLength)
> objDonkey.SelectedClient.AddDocument(objDonkey.UserName,
> sFileName, sContentType, iLength, bytContent, "this is a test
> document")
>
> End Sub
> Protected Sub btnGetDoc_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles btnGetDoc.Click
> Dim DocId As Integer
> Dim objDoc As Life.Clients.Client.DocumentItem
> DocId = HiddenSelectedDoc.Value
> objDonkey.SelectedClient.GetDocuments()
> objDoc = objDonkey.SelectedClient.DocumentList(DocId)
>
> Response.Buffer = True
> Response.Expires = -1
> Response.ClearContent()
> Response.ClearHeaders()
> Response.ContentType = "image/jpeg" 'objDoc.ContentType
> Response.OutputStream.Write(CType(objDonkey.SelectedClient.GetDocument(Doc
Id),
> Byte()), 0, CInt(objDoc.ContentLegnth))
> Response.AddHeader("Content-Disposition",
> "attachment;filename=" + objDoc.Filename)
> Response.Flush()
>
> End Sub