Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

Thursday, March 29, 2012

HTML in a variable

Im using asp on a win2k3 server. I would like to put a lot of html into 1 variable. I get an error when i try to do it my way.


'Here is an example of what I would like to do, kinda.
application="<html>
<head>
<title>Join</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="http://links.10026.com/?link=join.css" rel="stylesheet" type="text/css">
</head>"


'Here is the error.
Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/cfcs/join/mail.asp, line 17

application="<html>
------^

I was wondering if anyone could suggest an effective method of doing this.you should replace the double quotes(") by a single quote(') and instead of adding new line for the variable value you can use <br
application="<html><br><head><br><title>Join</title><br><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><br><link href='join.css' rel='stylesheet' type='text/css'><br></head></html>"

Hope this helps
Nitasha

------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
this isn't an asp forum

application = "<html>" & vbCrLf & "<head>" & vbCrLf & "<title>Join</title>" & vbCrLf & "<meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"">" & _
vbCrLf & "<link href="http://links.10026.com/?link="join.css"" rel=""stylesheet"" type=""text/css"">" & vbCrLf & "</head>"
The new lines in the string are not understood by VB.

HTML IMG vs ASP:IMAGE performance

I have no need to have server control over an image.
What is the best choice to use HTML img tag or asp:image for best
performance?
thanks,
Goncalo BoleoHTML controls provide slightly better performance than Web Controls, so go
with the img tag.
Here's more info:
http://SteveOrr.net/faq/3in1.aspx#HTMLvsWeb
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Gonalo Bolo" <gboleo@.netcabo.pt> wrote in message
news:el6Fu7PRFHA.356@.TK2MSFTNGP14.phx.gbl...
>I have no need to have server control over an image.
> What is the best choice to use HTML img tag or asp:image for best
> performance?
> thanks,
> Goncalo Boleo
>
If there's no need to have a server control, then just use a <img> tag (prim
arily
for simplicity, even though it is faster but it's negligible). If you are
using a server control there's essentially no difference between the HtmlCon
trols
and the WebContorls.
-Brock
DevelopMentor
http://staff.develop.com/ballen

> I have no need to have server control over an image.
> What is the best choice to use HTML img tag or asp:image for best
> performance?
> thanks,
> Goncalo Boleo

HTML IMG vs ASP:IMAGE performance

I have no need to have server control over an image.
What is the best choice to use HTML img tag or asp:image for best
performance?

thanks,
Goncalo BoleoHTML controls provide slightly better performance than Web Controls, so go
with the img tag.

Here's more info:
http://SteveOrr.net/faq/3in1.aspx#HTMLvsWeb

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Gonalo Bolo" <gboleo@.netcabo.pt> wrote in message
news:el6Fu7PRFHA.356@.TK2MSFTNGP14.phx.gbl...
>I have no need to have server control over an image.
> What is the best choice to use HTML img tag or asp:image for best
> performance?
> thanks,
> Goncalo Boleo
If there's no need to have a server control, then just use a <img> tag (primarily
for simplicity, even though it is faster but it's negligible). If you are
using a server control there's essentially no difference between the HtmlControls
and the WebContorls.

-Brock
DevelopMentor
http://staff.develop.com/ballen

> I have no need to have server control over an image.
> What is the best choice to use HTML img tag or asp:image for best
> performance?
> thanks,
> Goncalo Boleo

html hyperlink

I have an html that I made to a hyperlink. this is the code

HTML
<SPAN class="Hyperlink"><A id="CP" runat="server">Client List</A></SPAN>
Code
CP.HRef = "Index.aspx?Page=ClientList"

Now the thing I want to do is when I click it I want to clear all my session variables. Is there any suggestionsWhy not create a linkbutton and in the code behind, have it clear the sessions,
then redirect to the page you want?

Zath
yes use the linkbutton and put this code to clear the sessions:


Session.Clear();
Response.Redirect("myotherpage.aspx");

html forms within the server generated form tag

Ok, I'm using an XSL to generate the content div of a page. I'm using
http://script.aculo.us to do some asynch posting and getting so that I don't
actually have to have the server know what I've generated. The whole idea is
that the content is organic. That part is working. Except for one strange
thing... I'm not sure if this is an ASP.net thing, or something I just don't
know about the DOM. When I add sub-forms with just plain html form tags,
the first child form I add isn't recognized as a separate form. It's
contents are 'added' to the main form. I've worked around it by putting a
dummy do nothing form on the page in front of my other generated sub forms...
but what gives here? I know it's not my markup because if I reverse the
order of the generated forms, the FIRST sub-form on the page is always
'assimilated' in the aspNetform, I've tried everything to get this not to
happen, enclosing in divs, and even just making a page with nothing but
generated forms... same results every time. The first html form on the page
is ALWAYS added to the asp.net generated form, no matter what. Am I missing
something? (I find that every time I post here, I usually am)

html forms within the server generated form tag

Ok, I'm using an XSL to generate the content div of a page. I'm using
http://script.aculo.us to do some asynch posting and getting so that I don't
actually have to have the server know what I've generated. The whole idea i
s
that the content is organic. That part is working. Except for one strange
thing... I'm not sure if this is an ASP.net thing, or something I just don't
know about the DOM. When I add sub-forms with just plain html form tags,
the first child form I add isn't recognized as a separate form. It's
contents are 'added' to the main form. I've worked around it by putting a
dummy do nothing form on the page in front of my other generated sub forms..
.
but what gives here? I know it's not my markup because if I reverse the
order of the generated forms, the FIRST sub-form on the page is always
'assimilated' in the aspNetform, I've tried everything to get this not to
happen, enclosing in divs, and even just making a page with nothing but
generated forms... same results every time. The first html form on the page
is ALWAYS added to the asp.net generated form, no matter what. Am I missing
something? (I find that every time I post here, I usually am)

Monday, March 26, 2012

Html form trouble

Hi,
On my asp.net page I have an html form. I've set runat attribute to server
and filled it with server controls. All settings
are as I like them.
So here's the problem: when I perform a search for the first time, everythin
g works perfectly. If I make any changes to the
controls in the form and resubmit the page, nothing changes. That is, viewi
ng the querystring, not a single value is altered
despite my doing so in the form itself.
Is there some problem with the html form? I can't for the life of me figure
this out. Any help would be greatly appreciated.
Thanks,
RoshawnHi,
Roshawn wrote:
> Hi,
> On my asp.net page I have an html form. I've set runat attribute to
> server and filled it with server controls. All settings are as I like
> them.
> So here's the problem: when I perform a search for the first time,
> everything works perfectly. If I make any changes to the controls in
> the form and resubmit the page, nothing changes. That is, viewing the
> querystring, not a single value is altered despite my doing so in the
> form itself.
> Is there some problem with the html form? I can't for the life of me
> figure this out. Any help would be greatly appreciated.
> Thanks,
> Roshawn
We'll need to see some code. Please post an extract of your code able to
reproduce the problems, stripping what is not necessary.
Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Hi Laurent. Sorry for the delayed response, been busy. As you requested, h
ere's some code.
HTML Form
<form runat="server" enableviewstate="false">
<label for="q">Search:</label><br/>
<input type="text" name="q" id="q" maxlength="100" /><br/>
<label for="sz">Shoe Size:</label><br/>
<asp:dropdownlist id="sz" runat="server" enableviewstate="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="42802">5 & Smaller</asp:listitem>
<asp:listitem value="37090">6</asp:listitem>
<asp:listitem value="22806">7</asp:listitem>
<asp:listitem value="1032">8</asp:listitem>
'more listitems go here
</asp:dropdownlist><br/>
<label for="tp">Type:</label><br/>
<asp:dropdownlist runat="server" id="tp" enableviewstate="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="2293">Athletic</asp:listitem>
<asp:listitem value="31920">Athletic-Inspired</asp:listitem>
</asp:dropdownlist><br/>
<label for="cd">Condition:</label><br/>
<asp:dropdownlist id="cd" runat="server" enableviewstate="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="31919">New</asp:listitem>
</asp:dropdownlist><br/>
<input type="submit" id="submit" value="Search" />
</form>
Code to handle form (note that this uses the eBay XML API; it works as expec
ted and is called in the Page_Load event)
Private Sub GetShoeResults()
Dim hp As New MyHelper() 'declared variable for the MyHelper class for auxil
lary functions
Dim shoe As Shoe = New Shoe()'custom class
Dim sb As New StringBuilder("<?xml version=""1.0"" encoding=""utf-8""?>")
With sb
.Append("<GetSearchResultsRequest xmlns=""urn:ebay:apis:eBLBaseComponents"">
<RequesterCredentials><eBayAuthToken>" &
ConfigurationManager.AppSettings("Token") & "</eBayAuthToken></RequesterCred
entials>")
.Append("<CategoryID>63850</CategoryID><DetailLevel>ReturnAll</DetailLevel>"
)
If Request.QueryString("q") <> "" Then
.Append("<Query>" & Request.QueryString("q") & "</Query>")
End If
.Append("<SearchRequest><AttributeSetID>22</AttributeSetID><ProductFinderID>
22</ProductFinderID>")
'for the Size Parameter
If Request.QueryString("sz") <> "" Then
'turn off all selected items
For i = 0 To Me.sz.Items.Count - 1
Me.sz.Items(i).Selected = False
Next
.Append("<SearchAttributes><AttributeID>53</AttributeID><ValueList><ValueID>
" & Request.QueryString("sz") &
"</ValueID></ValueList></SearchAttributes>")
Dim item As ListItem
For Each item In Me.sz.Items
If item.Value = Request.QueryString("sz") Then
shoe.Size_ID = item.Value
shoe.Size = item.Text
item.Selected = True
Exit For
End If
Next
End If
'for the Type Parameter
If Request.QueryString("tp") <> "" Then
'turn off all selected items
For i = 0 To Me.tp.Items.Count - 1
Me.tp.Items(i).Selected = False
Next
.Append("<SearchAttributes><AttributeID>54</AttributeID><ValueList><ValueID>
" & Request.QueryString("tp") &
"</ValueID></ValueList></SearchAttributes>")
Dim item As ListItem
For Each item In Me.tp.Items
If item.Value = Request.QueryString("tp") Then
shoe.Type_ID = item.Value
shoe.Type = item.Text
item.Selected = True
Exit For
End If
Next
End If
'for the Condition Parameter
If Request.QueryString("cd") <> "" Then
'turn off all selected items
For i = 0 To Me.cd.Items.Count - 1
Me.cd.Items(i).Selected = False
Next
.Append("<SearchAttributes><AttributeID>94</AttributeID><ValueList><ValueID>
" & Request.QueryString("cd") &
"</ValueID></ValueList></SearchAttributes>")
Dim item2 As ListItem
For Each item2 In Me.cd.Items
If item2.Value = Request.QueryString("cd") Then
shoe.Condition_ID = item2.Value
shoe.Condition = item2.Text
item2.Selected = True
Exit For
End If
Next
End If
'Add Pagination in case a page number is returned in the querystring
.Append("<Pagination><EntriesPerPage>10</EntriesPerPage></Pagination></GetSe
archResultsRequest>")
End With
Try
Me.Xml1.DocumentContent = hp.CreateHeaders(sb.ToString())'call to eBay
Dim ext As New XsltArgumentList()
ext.AddExtensionObject("urn:Shoes", shoe)
Me.Xml1.TransformArgumentList = ext
Me.Xml1.TransformSource = "search.xslt"
Catch ex As WebException
'handle errors here
End Try
End Sub
I hope this helps you help me. Thanks for being interested. :-)
Roshawn

Html form trouble

Hi,

On my asp.net page I have an html form. I've set runat attribute to server and filled it with server controls. All settings
are as I like them.

So here's the problem: when I perform a search for the first time, everything works perfectly. If I make any changes to the
controls in the form and resubmit the page, nothing changes. That is, viewing the querystring, not a single value is altered
despite my doing so in the form itself.

Is there some problem with the html form? I can't for the life of me figure this out. Any help would be greatly appreciated.

Thanks,
RoshawnHi,

Roshawn wrote:

Quote:

Originally Posted by

Hi,
>
On my asp.net page I have an html form. I've set runat attribute to
server and filled it with server controls. All settings are as I like
them.
>
So here's the problem: when I perform a search for the first time,
everything works perfectly. If I make any changes to the controls in
the form and resubmit the page, nothing changes. That is, viewing the
querystring, not a single value is altered despite my doing so in the
form itself.
>
Is there some problem with the html form? I can't for the life of me
figure this out. Any help would be greatly appreciated.
>
Thanks,
Roshawn


We'll need to see some code. Please post an extract of your code able to
reproduce the problems, stripping what is not necessary.

Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Hi Laurent. Sorry for the delayed response, been busy. As you requested, here's some code.

HTML Form
<form runat="server" enableviewstate="false">
<label for="q">Search:</label><br/>
<input type="text" name="q" id="q" maxlength="100" /><br/>
<label for="sz">Shoe Size:</label><br/>
<asp:dropdownlist id="sz" runat="server" enableviewstate="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="42802">5 & Smaller</asp:listitem>
<asp:listitem value="37090">6</asp:listitem>
<asp:listitem value="22806">7</asp:listitem>
<asp:listitem value="1032">8</asp:listitem>
'more listitems go here
</asp:dropdownlist><br/>
<label for="tp">Type:</label><br/>
<asp:dropdownlist runat="server" id="tp" enableviewstate="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="2293">Athletic</asp:listitem>
<asp:listitem value="31920">Athletic-Inspired</asp:listitem>
</asp:dropdownlist><br/>
<label for="cd">Condition:</label><br/>
<asp:dropdownlist id="cd" runat="server" enableviewstate="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="31919">New</asp:listitem>
</asp:dropdownlist><br/>
<input type="submit" id="submit" value="Search" />
</form>

Code to handle form (note that this uses the eBay XML API; it works as expected and is called in the Page_Load event)
Private Sub GetShoeResults()
Dim hp As New MyHelper() 'declared variable for the MyHelper class for auxillary functions
Dim shoe As Shoe = New Shoe()'custom class
Dim sb As New StringBuilder("<?xml version=""1.0"" encoding=""utf-8""?>")
With sb
.Append("<GetSearchResultsRequest xmlns=""urn:ebay:apis:eBLBaseComponents""><RequesterCredentials><eBayAuthToken>" &
ConfigurationManager.AppSettings("Token") & "</eBayAuthToken></RequesterCredentials>")
.Append("<CategoryID>63850</CategoryID><DetailLevel>ReturnAll</DetailLevel>")
If Request.QueryString("q") <"" Then
.Append("<Query>" & Request.QueryString("q") & "</Query>")
End If
.Append("<SearchRequest><AttributeSetID>22</AttributeSetID><ProductFinderID>22</ProductFinderID>")
'for the Size Parameter
If Request.QueryString("sz") <"" Then
'turn off all selected items
For i = 0 To Me.sz.Items.Count - 1
Me.sz.Items(i).Selected = False
Next
.Append("<SearchAttributes><AttributeID>53</AttributeID><ValueList><ValueID>" & Request.QueryString("sz") &
"</ValueID></ValueList></SearchAttributes>")
Dim item As ListItem
For Each item In Me.sz.Items
If item.Value = Request.QueryString("sz") Then
shoe.Size_ID = item.Value
shoe.Size = item.Text
item.Selected = True
Exit For
End If
Next
End If
'for the Type Parameter
If Request.QueryString("tp") <"" Then
'turn off all selected items
For i = 0 To Me.tp.Items.Count - 1
Me.tp.Items(i).Selected = False
Next
.Append("<SearchAttributes><AttributeID>54</AttributeID><ValueList><ValueID>" & Request.QueryString("tp") &
"</ValueID></ValueList></SearchAttributes>")
Dim item As ListItem
For Each item In Me.tp.Items
If item.Value = Request.QueryString("tp") Then
shoe.Type_ID = item.Value
shoe.Type = item.Text
item.Selected = True
Exit For
End If
Next
End If
'for the Condition Parameter
If Request.QueryString("cd") <"" Then
'turn off all selected items
For i = 0 To Me.cd.Items.Count - 1
Me.cd.Items(i).Selected = False
Next
.Append("<SearchAttributes><AttributeID>94</AttributeID><ValueList><ValueID>" & Request.QueryString("cd") &
"</ValueID></ValueList></SearchAttributes>")
Dim item2 As ListItem
For Each item2 In Me.cd.Items
If item2.Value = Request.QueryString("cd") Then
shoe.Condition_ID = item2.Value
shoe.Condition = item2.Text
item2.Selected = True
Exit For
End If
Next
End If
'Add Pagination in case a page number is returned in the querystring
.Append("<Pagination><EntriesPerPage>10</EntriesPerPage></Pagination></GetSearchResultsRequest>")
End With
Try
Me.Xml1.DocumentContent = hp.CreateHeaders(sb.ToString())'call to eBay
Dim ext As New XsltArgumentList()
ext.AddExtensionObject("urn:Shoes", shoe)
Me.Xml1.TransformArgumentList = ext
Me.Xml1.TransformSource = "search.xslt"
Catch ex As WebException
'handle errors here
End Try
End Sub

I hope this helps you help me. Thanks for being interested. :-)

Roshawn

Html Form Help!

Hi,

I have an .aspx page that contains an html form. Below is the code used for the form:

<form id="Shoes" method="post" runat="server">
<label for="q">Search:</label><br />
<asp:textbox id="q" maxlength="100" runat="server"/><br />
<label for="sz">Shoe Size (US):</label><br />
<asp:dropdownlist id="sz" runat="server"/><br /> <!-- this control is populated programmatically -->
<label for="tp">Type:</label><br />
<asp:dropdownlist id="tp" runat="server">
<asp:listitem value="24">Any</asp:listitem>
<asp:listitem value="2293">Athletic</asp:listitem>
<asp:listitem value="31920">Athletic-Inspired</asp:listitem>
</asp:dropdownlist><br />
<label for="cd">Condition:</label><br />
<asp:dropdownlist id="cd" runat="server">
<asp:listitem value="24">Any</asp:listitem>
<asp:listitem value="31919">New</asp:listitem>
</asp:dropdownlist><br />
<input type="submit" value="Search"/>
</form
All is good here.

But should I specify any form variables and perform a postback, I can't access any of the form
controls using either the Request.Form collection or using Request.Querystring collection.

I have no idea why this is happening. Can anyone help this newbie?

Thanks,
RoshawnI don't see anything particularly wrong with your form ASPX tag code.
You have not shown how you expect to access these values on a postback.

The typicaly pattern is:

Page_Load( ...)
{
if(IsPostBack)
{
//get values here

}

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

"Roshawn Dawson" wrote:

> Hi,
> I have an .aspx page that contains an html form. Below is the code used for the form:
>
> <form id="Shoes" method="post" runat="server">
> <label for="q">Search:</label><br />
> <asp:textbox id="q" maxlength="100" runat="server"/><br />
> <label for="sz">Shoe Size (US):</label><br />
> <asp:dropdownlist id="sz" runat="server"/><br /> <!-- this control is populated programmatically -->
> <label for="tp">Type:</label><br />
> <asp:dropdownlist id="tp" runat="server">
> <asp:listitem value="24">Any</asp:listitem>
> <asp:listitem value="2293">Athletic</asp:listitem>
> <asp:listitem value="31920">Athletic-Inspired</asp:listitem>
> </asp:dropdownlist><br />
> <label for="cd">Condition:</label><br />
> <asp:dropdownlist id="cd" runat="server">
> <asp:listitem value="24">Any</asp:listitem>
> <asp:listitem value="31919">New</asp:listitem>
> </asp:dropdownlist><br />
> <input type="submit" value="Search"/>
> </form>
>
> All is good here.
> But should I specify any form variables and perform a postback, I can't access any of the form
> controls using either the Request.Form collection or using Request.Querystring collection.
> I have no idea why this is happening. Can anyone help this newbie?
> Thanks,
> Roshawn
Hmm...

Your suggestion is simple enough. I though that you don't always have to check if the page was
posted back. I thought that I could slap some code onto the page and simply use the Request object.
Seems I was wrong.

Thanks for the tip, Peter. :-)

Peter Bromberg [C# MVP] wrote:
> I don't see anything particularly wrong with your form ASPX tag code.
> You have not shown how you expect to access these values on a postback.
> The typicaly pattern is:
> Page_Load( ...)
> {
> if(IsPostBack)
> {
> //get values here
> }
> Peter
I appreciate your suggestion, but unfortunately nothing works. I still cannot use the Request.Form
collection or the Request.QueryString collection.

Thanks anyway,
Roshawn
If you want to post a "Short but complete" code sample, sombody will review
it. How about your AutoEventWireup directive, how is that set? Have you set a
breakpont on the code line that you expect to see executed, to see if it is
actually reached? Have you tried using the locals window to look at values?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

"Roshawn Dawson" wrote:

> I appreciate your suggestion, but unfortunately nothing works. I still cannot use the Request.Form
> collection or the Request.QueryString collection.
> Thanks anyway,
> Roshawn
Hi, Roshawn.

What you are looking for is the Request.Params collection.

See example usage at :
http://www.informit.com/articles/ar...2&seqNum=4&rl=1

http://www.hanselman.com/blog/ASPNE...leDecoding.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Roshawn Dawson" <udrago@.bellsouth.net> wrote in message
news:uxxSlDzcGHA.4072@.TK2MSFTNGP05.phx.gbl...
>I appreciate your suggestion, but unfortunately nothing works. I still cannot use the Request.Form
>collection or the Request.QueryString collection.
> Thanks anyway,
> Roshawn
Hi Juan,

I've done some more testing, and what I found is strange. Both the Request.Params and the
Request.QueryString collections are empty.

I have no idea why this is. Could setting the EnableViewState property to true have an effect on
these collections?

Thanks,
Roshawn

Juan T. Llibre wrote:
> Hi, Roshawn.
> What you are looking for is the Request.Params collection.
> See example usage at :
> http://www.informit.com/articles/ar...2&seqNum=4&rl=1
> http://www.hanselman.com/blog/ASPNE...leDecoding.aspx
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
Never mind; I figured it out. Silly me, I didn't supply a name attribute for any of the form's
controls. That's why I couldn't get any data.

And to think that I need a hairpiece for nothing (I pulled all of it out). :-(

Thanks gang,
Roshawn
heh, heh...
Been there, done that!

I bet it felt good to finally figure it out!

:-)

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Roshawn Dawson" <udrago@.bellsouth.net> wrote in message
news:%23WISox%23cGHA.536@.TK2MSFTNGP02.phx.gbl...
> Never mind; I figured it out. Silly me, I didn't supply a name attribute for any of the form's
> controls. That's why I couldn't get any data.
> And to think that I need a hairpiece for nothing (I pulled all of it out). :-(
> Thanks gang,
> Roshawn

Html Form Help!

Hi,
I have an .aspx page that contains an html form. Below is the code used for
the form:
<form id="Shoes" method="post" runat="server">
<label for="q">Search:</label><br />
<asp:textbox id="q" maxlength="100" runat="server"/><br />
<label for="sz">Shoe Size (US):</label><br />
<asp:dropdownlist id="sz" runat="server"/><br /> <!-- this control is popu
lated programmatically -->
<label for="tp">Type:</label><br />
<asp:dropdownlist id="tp" runat="server">
<asp:listitem value="24">Any</asp:listitem>
<asp:listitem value="2293">Athletic</asp:listitem>
<asp:listitem value="31920">Athletic-Inspired</asp:listitem>
</asp:dropdownlist><br />
<label for="cd">Condition:</label><br />
<asp:dropdownlist id="cd" runat="server">
<asp:listitem value="24">Any</asp:listitem>
<asp:listitem value="31919">New</asp:listitem>
</asp:dropdownlist><br />
<input type="submit" value="Search"/>
</form>
All is good here.
But should I specify any form variables and perform a postback, I can't acce
ss any of the form
controls using either the Request.Form collection or using Request.Querystri
ng collection.
I have no idea why this is happening. Can anyone help this newbie?
Thanks,
RoshawnI don't see anything particularly wrong with your form ASPX tag code.
You have not shown how you expect to access these values on a postback.
The typicaly pattern is:
Page_Load( ...)
{
if(IsPostBack)
{
//get values here
}
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Roshawn Dawson" wrote:

> Hi,
> I have an .aspx page that contains an html form. Below is the code used f
or the form:
>
> <form id="Shoes" method="post" runat="server">
> <label for="q">Search:</label><br />
> <asp:textbox id="q" maxlength="100" runat="server"/><br />
> <label for="sz">Shoe Size (US):</label><br />
> <asp:dropdownlist id="sz" runat="server"/><br /> <!-- this control is
populated programmatically -->
> <label for="tp">Type:</label><br />
> <asp:dropdownlist id="tp" runat="server">
> <asp:listitem value="24">Any</asp:listitem>
> <asp:listitem value="2293">Athletic</asp:listitem>
> <asp:listitem value="31920">Athletic-Inspired</asp:listitem>
> </asp:dropdownlist><br />
> <label for="cd">Condition:</label><br />
> <asp:dropdownlist id="cd" runat="server">
> <asp:listitem value="24">Any</asp:listitem>
> <asp:listitem value="31919">New</asp:listitem>
> </asp:dropdownlist><br />
> <input type="submit" value="Search"/>
> </form>
>
> All is good here.
> But should I specify any form variables and perform a postback, I can't ac
cess any of the form
> controls using either the Request.Form collection or using Request.Queryst
ring collection.
> I have no idea why this is happening. Can anyone help this newbie?
> Thanks,
> Roshawn
>
Hmm...
Your suggestion is simple enough. I though that you don't always have to ch
eck if the page was
posted back. I thought that I could slap some code onto the page and simply
use the Request object.
Seems I was wrong.
Thanks for the tip, Peter. :-)
Peter Bromberg [C# MVP] wrote:
> I don't see anything particularly wrong with your form ASPX tag code.
> You have not shown how you expect to access these values on a postback.
> The typicaly pattern is:
> Page_Load( ...)
> {
> if(IsPostBack)
> {
> //get values here
> }
> Peter
I appreciate your suggestion, but unfortunately nothing works. I still cann
ot use the Request.Form
collection or the Request.QueryString collection.
Thanks anyway,
Roshawn
If you want to post a "Short but complete" code sample, sombody will review
it. How about your AutoEventWireup directive, how is that set? Have you set
a
breakpont on the code line that you expect to see executed, to see if it is
actually reached? Have you tried using the locals window to look at values?
Peter
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Roshawn Dawson" wrote:

> I appreciate your suggestion, but unfortunately nothing works. I still ca
nnot use the Request.Form
> collection or the Request.QueryString collection.
> Thanks anyway,
> Roshawn
>
Hi, Roshawn.
What you are looking for is the Request.Params collection.
See example usage at :
http://www.informit.com/articles/ar...2&seqNum=4&rl=1
http://www.hanselman.com/blog/ ASPN...leDecoding.aspx
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Roshawn Dawson" <udrago@.bellsouth.net> wrote in message
news:uxxSlDzcGHA.4072@.TK2MSFTNGP05.phx.gbl...
>I appreciate your suggestion, but unfortunately nothing works. I still can
not use the Request.Form
>collection or the Request.QueryString collection.
> Thanks anyway,
> Roshawn
Hi Juan,
I've done some more testing, and what I found is strange. Both the Request.
Params and the
Request.QueryString collections are empty.
I have no idea why this is. Could setting the EnableViewState property to t
rue have an effect on
these collections?
Thanks,
Roshawn
Juan T. Llibre wrote:
> Hi, Roshawn.
> What you are looking for is the Request.Params collection.
> See example usage at :
> http://www.informit.com/articles/ar...2&seqNum=4&rl=1
> http://www.hanselman.com/blog/ ASPN...leDecoding.aspx
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
Never mind; I figured it out. Silly me, I didn't supply a name attribute fo
r any of the form's
controls. That's why I couldn't get any data.
And to think that I need a hairpiece for nothing (I pulled all of it out).
:-(
Thanks gang,
Roshawn
heh, heh...
Been there, done that!
I bet it felt good to finally figure it out!
:-)
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Roshawn Dawson" <udrago@.bellsouth.net> wrote in message
news:%23WISox%23cGHA.536@.TK2MSFTNGP02.phx.gbl...
> Never mind; I figured it out. Silly me, I didn't supply a name attribute
for any of the form's
> controls. That's why I couldn't get any data.
> And to think that I need a hairpiece for nothing (I pulled all of it out).
:-(
> Thanks gang,
> Roshawn

HTML file server side includes plus forms authentication

We've got a project going that involves moving an old web site with a
massive dll written in C++ that produces most of the output from a SQL 7.0
data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new
code is being written in C# using ASP.NET and we are using forms
authentication to control access to particular directories/applications.
We are having a hard time figuring out how to configure the thing so that
existing html files both a) have access controlled through ASP.NET forms
authentication and b) render server side includes correctly. If we
configure the htm/html files for the application on IIS to be handled by
ssinc.dll the includes are rendered correctly, but access is not restricted
by forms authentication. If we configure them to be handled by
aspnet_isapi.dll we get forms authentication control, but the includes are
ignored.
Oddly, simply renaming a file from *.html to *.aspx with no other changes
results in aspnet_isapi.dll handling it correctly -- providing forms
authentication access control and also rendering includes correctly. But if
the file name is *.htm or *.html, aspnet_isapi.dll fails to include the
includes. It almost seems like this is a bug! I cannot, at any rate, see
any reason why it would do this by design.
So, in theory, we could solve the problem by just re-naming all our htm/html
files with an aspx extension instead. Unfortunately this is not so easily
done in practice since the old C++ .dll that creates most pages and fills
them with stuff from the data base has hyperlinks to the *.html files hard
coded into it all over the place. It is not impossible to change this, but
we'd like to find a simpler way.
Can anyone offer a suggestion for a way to resolve this problem? Is it
simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
fails to do so for an otherwise identical files with a .htm or .html
extension?
All the best,
will
William F. Zachmann, President
Canopus Research Inc.
http://www.canopusresearch.comHi William!

> Is it
> simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
> fails to do so for an otherwise identical files with a .htm or .html
> extension?
I don't think it's a bug. Probably your IIS is configured in way that
*.aspx files are handled by aspnet_isapi.dll, but .htm/.html are not. To
change this mapping (for IIS 6) go to "Application settings" (tab "Home
directory" or "Virtual directory")
"Application settings", click "Configuration". On the "Mapping" tab, have a
look at the "Application extension", especially the ".aspx" mapping. Create
a similar extension mapping for ".htm" and ".html".
Now IIS will handle your .htm files using aspnet_isapi.dll. If you still
need more control you will need a custom http handler.
Alex
http://www.DotNet42.com - The Answer to Your DotNet Question
"William F. Zachmann" wrote:

> We've got a project going that involves moving an old web site with a
> massive dll written in C++ that produces most of the output from a SQL 7.0
> data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new
> code is being written in C# using ASP.NET and we are using forms
> authentication to control access to particular directories/applications.
> We are having a hard time figuring out how to configure the thing so that
> existing html files both a) have access controlled through ASP.NET forms
> authentication and b) render server side includes correctly. If we
> configure the htm/html files for the application on IIS to be handled by
> ssinc.dll the includes are rendered correctly, but access is not restricte
d
> by forms authentication. If we configure them to be handled by
> aspnet_isapi.dll we get forms authentication control, but the includes are
> ignored.
> Oddly, simply renaming a file from *.html to *.aspx with no other changes
> results in aspnet_isapi.dll handling it correctly -- providing forms
> authentication access control and also rendering includes correctly. But
if
> the file name is *.htm or *.html, aspnet_isapi.dll fails to include the
> includes. It almost seems like this is a bug! I cannot, at any rate, see
> any reason why it would do this by design.
> So, in theory, we could solve the problem by just re-naming all our htm/ht
ml
> files with an aspx extension instead. Unfortunately this is not so easily
> done in practice since the old C++ .dll that creates most pages and fills
> them with stuff from the data base has hyperlinks to the *.html files hard
> coded into it all over the place. It is not impossible to change this, bu
t
> we'd like to find a simpler way.
> Can anyone offer a suggestion for a way to resolve this problem? Is it
> simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
> fails to do so for an otherwise identical files with a .htm or .html
> extension?
> All the best,
> will
> William F. Zachmann, President
> Canopus Research Inc.
> http://www.canopusresearch.com
>
>
Alex,
Apparently I was not clear enough. I had already done that. IIS is already
handling my htm/html files through aspnet_isapi.dll. That brings them under
forms control access, but the includes are not rendered correctly. If I
re-name them to *.aspx, then they are handled correctly. Named *.htm/html
(with those extensions mapped to aspnet_isapi.dll) forms control works, but
includes are not rendered. If I map them to ssinc.dll, then includes are
rendered but I get no forms based access control.
All the best,
will
"Alex" <Alex@.discussions.microsoft.com> wrote in message
news:F8316EA5-66A5-493A-BFE3-93334F741F13@.microsoft.com...
> Hi William!
>
> I don't think it's a bug. Probably your IIS is configured in way that
> *.aspx files are handled by aspnet_isapi.dll, but .htm/.html are not. To
> change this mapping (for IIS 6) go to "Application settings" (tab "Home
> directory" or "Virtual directory")
> "Application settings", click "Configuration". On the "Mapping" tab, have
> a
> look at the "Application extension", especially the ".aspx" mapping.
> Create
> a similar extension mapping for ".htm" and ".html".
> Now IIS will handle your .htm files using aspnet_isapi.dll. If you still
> need more control you will need a custom http handler.
> Alex
> http://www.DotNet42.com - The Answer to Your DotNet Question
>
>
>
> "William F. Zachmann" wrote:
>
Will,
how about this:
1. Rename your .html files to .aspx
2. For the .html hyperlinks generated by your DLL you write an HTTP Handler
that does an URL rewrite from .html to .aspx.
For example this is what happens when you click on
http://www.dotnet42.com/NG_microsof...drawing/A_605/T
hreadDetail.htm
Alex
http://www.DotNet42.com - The Answer to Your DotNet Question
"William F. Zachmann" wrote:

> We've got a project going that involves moving an old web site with a
> massive dll written in C++ that produces most of the output from a SQL 7.0
> data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new
> code is being written in C# using ASP.NET and we are using forms
> authentication to control access to particular directories/applications.
> We are having a hard time figuring out how to configure the thing so that
> existing html files both a) have access controlled through ASP.NET forms
> authentication and b) render server side includes correctly. If we
> configure the htm/html files for the application on IIS to be handled by
> ssinc.dll the includes are rendered correctly, but access is not restricte
d
> by forms authentication. If we configure them to be handled by
> aspnet_isapi.dll we get forms authentication control, but the includes are
> ignored.
> Oddly, simply renaming a file from *.html to *.aspx with no other changes
> results in aspnet_isapi.dll handling it correctly -- providing forms
> authentication access control and also rendering includes correctly. But
if
> the file name is *.htm or *.html, aspnet_isapi.dll fails to include the
> includes. It almost seems like this is a bug! I cannot, at any rate, see
> any reason why it would do this by design.
> So, in theory, we could solve the problem by just re-naming all our htm/ht
ml
> files with an aspx extension instead. Unfortunately this is not so easily
> done in practice since the old C++ .dll that creates most pages and fills
> them with stuff from the data base has hyperlinks to the *.html files hard
> coded into it all over the place. It is not impossible to change this, bu
t
> we'd like to find a simpler way.
> Can anyone offer a suggestion for a way to resolve this problem? Is it
> simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
> fails to do so for an otherwise identical files with a .htm or .html
> extension?
> All the best,
> will
> William F. Zachmann, President
> Canopus Research Inc.
> http://www.canopusresearch.com
>
>
asp.net processing is a two part
1) map file extension to asp.net dll - this enables form authenication
2) <@. page > directive is found, this causes the page to processed as an
asp.net page and implements the include logic.
you can just add the <@.page> directive to your html pages and you're good to
go.
-- bruce (sqlwork.com)
"William F. Zachmann" <wfz@.NOcanopusresearchSPAM.com> wrote in message
news:e9bNSyE2FHA.2540@.TK2MSFTNGP09.phx.gbl...
> We've got a project going that involves moving an old web site with a
> massive dll written in C++ that produces most of the output from a SQL 7.0
> data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new
> code is being written in C# using ASP.NET and we are using forms
> authentication to control access to particular directories/applications.
> We are having a hard time figuring out how to configure the thing so that
> existing html files both a) have access controlled through ASP.NET forms
> authentication and b) render server side includes correctly. If we
> configure the htm/html files for the application on IIS to be handled by
> ssinc.dll the includes are rendered correctly, but access is not
> restricted by forms authentication. If we configure them to be handled by
> aspnet_isapi.dll we get forms authentication control, but the includes are
> ignored.
> Oddly, simply renaming a file from *.html to *.aspx with no other changes
> results in aspnet_isapi.dll handling it correctly -- providing forms
> authentication access control and also rendering includes correctly. But
> if the file name is *.htm or *.html, aspnet_isapi.dll fails to include the
> includes. It almost seems like this is a bug! I cannot, at any rate, see
> any reason why it would do this by design.
> So, in theory, we could solve the problem by just re-naming all our
> htm/html files with an aspx extension instead. Unfortunately this is not
> so easily done in practice since the old C++ .dll that creates most pages
> and fills them with stuff from the data base has hyperlinks to the *.html
> files hard coded into it all over the place. It is not impossible to
> change this, but we'd like to find a simpler way.
> Can anyone offer a suggestion for a way to resolve this problem? Is it
> simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
> fails to do so for an otherwise identical files with a .htm or .html
> extension?
> All the best,
> will
> William F. Zachmann, President
> Canopus Research Inc.
> http://www.canopusresearch.com
>
Bruce,
Sounds like you have provided the specific information I needed. I will try
that out to confirm that it works. Thanks very much!
All the best,
will
"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:%23CYQWpL2FHA.3568@.TK2MSFTNGP15.phx.gbl...
> asp.net processing is a two part
> 1) map file extension to asp.net dll - this enables form authenication
> 2) <@. page > directive is found, this causes the page to processed as an
> asp.net page and implements the include logic.
> you can just add the <@.page> directive to your html pages and you're good
> to go.
> -- bruce (sqlwork.com)
>
> "William F. Zachmann" <wfz@.NOcanopusresearchSPAM.com> wrote in message
> news:e9bNSyE2FHA.2540@.TK2MSFTNGP09.phx.gbl...
>
Alex,
Thanks for your intention to help however, if you read through my original
message, you will see that I have already considered the possibility of
simply re-naming the htm/html files with aspx extensions but that this is
not a very good option since the old (massive) C++ dll has many hard-coded
dependencies tied to the file (and, for that matter, directory) names. I
quite explicitly said that I was looking for another alternative.
All the best,
will
"Alex" <Alex@.discussions.microsoft.com> wrote in message
news:7CA1CE05-59A9-4107-BCAF-8675AB75E4BE@.microsoft.com...
> Will,
> how about this:
> 1. Rename your .html files to .aspx
> 2. For the .html hyperlinks generated by your DLL you write an HTTP
> Handler
> that does an URL rewrite from .html to .aspx.
> For example this is what happens when you click on
> http://www.dotnet42.com/NG_microsof...ww.DotNet42.com - The Answer to Your DotNet Question
>
> "William F. Zachmann" wrote:
>

HTML file from database to user interface

HTML file from database to user interface
I have a html document in a sql server table with tags and elements. I need
to read it from table field and show it in a web page. Is there any
component that I can use to show this html file in the browsed with
interpreting the html tags.Couldn't you just select the rows from the data and write out each raw line
with response.write(<data> )?
"JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
news:10BCEEB4-E71E-43B2-849B-19E71953C348@.microsoft.com...
> HTML file from database to user interface
> I have a html document in a sql server table with tags and elements. I
> need
> to read it from table field and show it in a web page. Is there any
> component that I can use to show this html file in the browsed with
> interpreting the html tags.
>
This page has other components and I need to show this html in the middle
section, I probably need a component that does that.
"bill" wrote:

> Couldn't you just select the rows from the data and write out each raw lin
e
> with response.write(<data> )?
> "JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
> news:10BCEEB4-E71E-43B2-849B-19E71953C348@.microsoft.com...
>
>
You could put this in a literal control making this html fragment appears at
the exact location you want...
Patrice
"JIM.H." <JIMH@.discussions.microsoft.com> a crit dans le message de news:
AF276C5B-8F44-4D1E-B124-33AA23223736@.microsoft.com...
> This page has other components and I need to show this html in the middle
> section, I probably need a component that does that.
> "bill" wrote:
>
I am quite new, can you give me an example pelase?
"Patrice" wrote:

> You could put this in a literal control making this html fragment appears
at
> the exact location you want...
> --
> Patrice
> "JIM.H." <JIMH@.discussions.microsoft.com> a écrit dans le message de news
:
> AF276C5B-8F44-4D1E-B124-33AA23223736@.microsoft.com...
>
>
An example of which part? You just select the data from the database, loop
through the result set, and for each loop you simply put
"response.write(<yourdata> )"...
"JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
news:56642F77-1368-4BFE-82E9-17E35DAD1473@.microsoft.com...
>I am quite new, can you give me an example pelase?
> "Patrice" wrote:
>
Here is some sample/psuedo code. This should give you a good idea of
how to implement this.
<%@. Control ClassName="DataBaseHtmlLiteral" %>
<script runat="server">
Public DataBaseID as integer
Sub OnPreRender
' create sql connection and command
SqlCmd = "Select TOP 1 [Table].[html] from [Table] WHERE [Table].
[IDField] = @.ID"
SqlCmd.Parameters.add("@.ID",DatabaseID)
HTML.Text = DirectCast(SqlCmd.ExecuteScalar(),String)
' clean up (close connection etc.)
End Sub
</script>
<asp:Literal ID="HTML" runat="server" />
Each instance requires the DataBaseID to be set.
This assumes a single instance of the html, if you are looping through
the table, do not use this. Don't want
Also, error catching is needed (row doesn't exist, column is null,
DataBaseID is null, etc)
Hope this helps!
I guess you meant Literal?
JIM. H. wrote:
> HTML file from database to user interface
> I have a html document in a sql server table with tags and elements. I ne
ed
> to read it from table field and show it in a web page. Is there any
> component that I can use to show this html file in the browsed with
> interpreting the html tags.

html error

i have a freetextbox that is a htmleditor , but when i want to send my html to server an error raise.
for example i want to send this line

hello

this error raises :
A potentially dangerous Request.Form value was detected from the client (ftbCaption="<STRONG>hello</STRON...")

how can i pervent this error?check out the FTB forums
http://www.freetextbox.com/forums/ShowPost.aspx?PostID=496

short anwser = put this line in your page directive:
ValidateRequest=false

that worked for me

Saturday, March 24, 2012

Html email with embeded image-background?

Hi

I want to create an email message that has an image background embeded in the email message Itself

Not referenced to an image on the server. Any one can help please.

HTML Data generated by Server.Controls

hi guys!
i've got very interesting problem. it is like this.
is it possible to get HTML generated by the server control in code
behind?

i'm developing an asp.net web application where i need to fectch data
in HTML format. The data is rendered by the Data Repeater in Table
format on webpage.

is there any way i can get reder data of data repeater from itself? i
mean is there any method of anyway to get html data from HTML Control?
like GetHTML() or any properties or work around?

i tried with RenderControl() method but i failed.

the HTML Render Data generated by the Data Repeater is this :
<Table>
<tr>
<th>Col1</th>
<th>Col2</th>
<th>Col3</th>
</tr>
<tr>
<td>Col1</td>
<td>Col2</td>
<td>Col3</td>
</tr>
</Table>

i want this data in code behind.

if anyone know please let me know.

Thursday, March 22, 2012

HTML Controls vs. Web Controls

What are the advantages and divantages of using HTML Server Controls over
Web Server Controls and vice versa? Is there a clear cut consensus among
ASP.NET developers over which controls to use?
ThanksUse HTML Server controls (HTML control with "runat=server" added) when
migrating non-.NET forms to .NET.
Use Web Forms controls for new UI development that needs server-side
programmatic functionality.
Use HTML controls when no server-side functionality is needed.
"brian" <brian@.discussions.microsoft.com> wrote in message
news:3435A1A5-825B-48A5-8F65-937D2883E223@.microsoft.com...
> What are the advantages and divantages of using HTML Server Controls
> over
> Web Server Controls and vice versa? Is there a clear cut consensus among
> ASP.NET developers over which controls to use?
> Thanks
>
"brian" <brian@.discussions.microsoft.com> wrote in message
news:3435A1A5-825B-48A5-8F65-937D2883E223@.microsoft.com...
> What are the advantages and divantages of using HTML Server Controls
over
> Web Server Controls and vice versa? Is there a clear cut consensus among
> ASP.NET developers over which controls to use?
In addition to Scott's post:
- Use HTML Server controls when you want full control over the HTML that is
rendered.
- Some HTML Server controls don't have a Web Server Control equivalent such
as the HtmlInputFile (upload) control
- HTML Server controls are slightly faster than Web controls.
HTML controls are light and simple, while Web Controls are full of extra
functionality.
Here are more details for you:
http://SteveOrr.net/FAQ/3in1.aspx#HTMLvsWeb
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"brian" <brian@.discussions.microsoft.com> wrote in message
news:3435A1A5-825B-48A5-8F65-937D2883E223@.microsoft.com...
> What are the advantages and divantages of using HTML Server Controls
> over
> Web Server Controls and vice versa? Is there a clear cut consensus among
> ASP.NET developers over which controls to use?
> Thanks
>

HTML Controls vs. Web Controls

What are the advantages and disadvantages of using HTML Server Controls over
Web Server Controls and vice versa? Is there a clear cut consensus among
ASP.NET developers over which controls to use?

ThanksUse HTML Server controls (HTML control with "runat=server" added) when
migrating non-.NET forms to .NET.
Use Web Forms controls for new UI development that needs server-side
programmatic functionality.
Use HTML controls when no server-side functionality is needed.

"brian" <brian@.discussions.microsoft.com> wrote in message
news:3435A1A5-825B-48A5-8F65-937D2883E223@.microsoft.com...
> What are the advantages and disadvantages of using HTML Server Controls
> over
> Web Server Controls and vice versa? Is there a clear cut consensus among
> ASP.NET developers over which controls to use?
> Thanks
"brian" <brian@.discussions.microsoft.com> wrote in message
news:3435A1A5-825B-48A5-8F65-937D2883E223@.microsoft.com...
> What are the advantages and disadvantages of using HTML Server Controls
over
> Web Server Controls and vice versa? Is there a clear cut consensus among
> ASP.NET developers over which controls to use?

In addition to Scott's post:
- Use HTML Server controls when you want full control over the HTML that is
rendered.
- Some HTML Server controls don't have a Web Server Control equivalent such
as the HtmlInputFile (upload) control
- HTML Server controls are slightly faster than Web controls.
HTML controls are light and simple, while Web Controls are full of extra
functionality.
Here are more details for you:
http://SteveOrr.net/FAQ/3in1.aspx#HTMLvsWeb

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"brian" <brian@.discussions.microsoft.com> wrote in message
news:3435A1A5-825B-48A5-8F65-937D2883E223@.microsoft.com...
> What are the advantages and disadvantages of using HTML Server Controls
> over
> Web Server Controls and vice versa? Is there a clear cut consensus among
> ASP.NET developers over which controls to use?
> Thanks

HTML Controls or Web Server Controls?

there are 2 different categories of controls in asp.net2.0, the HTML controls and WebServer controls, what are the differences in terms of usage?

or in what circumstances each of these 2 categories should be used?

The HTML controls are primarily used when porting old ASP applications (or plain HTML) pages to ASP.NET. They are also sometimes used when you want to write large amounts of client-side JavaScript.

The ASP.NET server-side controls are used when you want to write server-side code to get/set the values of the controls (but bear in mind that they render as standard markup, so you can also program against them on the client if you want).

The ASP.NET controls offer a much cleaner and consistent object model for programming (on the server), whereas the HTML controls (when marked with runat="server") provide a less consistent model. For example, an ASP.NET TextBox is used to represent text, textarea and password input controls, just by setting its TextMode property.

The ASP.NET controls are also great when used in conjunction with validation controls.

Finally, ASP.NET controls remember there state between round-trips. The HTML controls do not, so you either have to set their values or mark them with runat="server" to give them a server-side presence so that ASP.NET can reset their state for you.

Consequently, the ASP.NET controls should be used in by far the majority of cases.


Try this:http://www.odetocode.com/Articles/348.aspx

Hope that helps.

Aaron

HTML controls instead of .Net server controls

Another front end guy that I work with wants to use old HTML controls instead
of the new .NET server controls. Since he is a old HTML and classic asp
person and is familiar with this, he wants to the old HTML controls instead
of the new .Net controls on a .Net web page. Please give me some opinions on
this. What are disadvantages or advantages, if any?

PS - I only use the new .Net controls. Never have used the old control
except for the file upload.

--
Chris DavoliJeesh. Tell him to wake up and join the 21st century. Really, man.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Chris Davoli" wrote:

Quote:

Originally Posted by

Another front end guy that I work with wants to use old HTML controls instead
of the new .NET server controls. Since he is a old HTML and classic asp
person and is familiar with this, he wants to the old HTML controls instead
of the new .Net controls on a .Net web page. Please give me some opinions on
this. What are disadvantages or advantages, if any?
>
PS - I only use the new .Net controls. Never have used the old control
except for the file upload.
>
--
Chris Davoli
>


Peter Bromberg [C# MVP] napisa?(a):

Quote:

Originally Posted by

Jeesh. Tell him to wake up and join the 21st century. Really, man.
Peter


Web server controls are not always the best choice. If you want to take
care of quality of your (x)html code (in terms of web standards) and
build modern, cross-browser websites, you often must forget about some
of web controls because they're generating ugly and old-fashioned
markup. Especially in ASP.NET 1.1 that was a big problem. In that cases
html server controls was good alternative because you had full control
(almost) of the code you generate. Of course it requires some more
knowledge and skills (properly use (x)html - to deliver content and not
presentation, css to deliver presentational informatons and
javascript(ecmascript) to add behaviors) than using web server controls,
but its definitely good idea if we talk about modern, accessible and
cross-browser websites.
Html server controls have one more advantage - lower performance cost
than most of server controls.
So it's not so easy decision to get rid of html server controls and
advance into 21th century:)

--
It was my opinion and i'm definitely agree with it:)
PP
I was once an old school HTML instead of .Net but with VS2005 they have come a
long, long way. There are just to many advantages to ignore the new controls. I
don't event think about it anymore - the performance hit on most web pages is
insignificant - use the new controls.

On Fri, 15 Sep 2006 18:46:01 -0700, Chris Davoli
<ChrisDavoli@.discussions.microsoft.comwrote:

Quote:

Originally Posted by

>Another front end guy that I work with wants to use old HTML controls instead
>of the new .NET server controls. Since he is a old HTML and classic asp
>person and is familiar with this, he wants to the old HTML controls instead
>of the new .Net controls on a .Net web page. Please give me some opinions on
>this. What are disadvantages or advantages, if any?
>
>PS - I only use the new .Net controls. Never have used the old control
>except for the file upload.

HTML control Vs Web form control

Hi,

I am new to asp.net. I want to know that, HTML and Web form control can work
in same way example, using "runat = Server" attribute, html control can also
executed at server, then what is the use of HTML control and is there is any
specific condition when we use only HTML control or web form control.

Thanks and regards,
Bhuwan"Bhuwan Bhaskar" <kxxx@.gmail.comwrote in message
news:uxe%23IJ4HIHA.4560@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

I am new to asp.net. I want to know that, HTML and Web form control can
work in same way example, using "runat = Server" attribute, html control
can also executed at server, then what is the use of HTML control and is
there is any specific condition when we use only HTML control or web form
control.


http://www.google.co.uk/search?sour...ls+HTMLControls
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Html controls are lighter. One of typical scenarios where you may want to
use html controls is when you have an html prototype of your page and you
need to program it in asp.net. Then it is easier just to add runat=server to
html controls.

Web controls offer common set of server-side members that can make your code
cleaner and more readable.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Bhuwan Bhaskar" <kxxx@.gmail.comwrote in message
news:uxe%23IJ4HIHA.4560@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

Hi,
>
I am new to asp.net. I want to know that, HTML and Web form control can
work in same way example, using "runat = Server" attribute, html control
can also executed at server, then what is the use of HTML control and is
there is any specific condition when we use only HTML control or web form
control.
>
Thanks and regards,
Bhuwan
>