By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,083 Members | 1,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,083 IT Pros & Developers. It's quick & easy.

what's the difference between a normal form element and a web control element?

P: n/a
Hi,

What's the difference between a normal web element:

<input type="text" id="txtname" name="txtname" runat="server">

vs webcontrol text box:

<asp:Textbox id="username" Columns="10" runat="server">
</asp:TextBox>

When should we use the normal input text box and when should we use the asp
textbox?

please advise.

Thanks.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 24 '07 #1
Share this Question
Share on Google+
12 Replies


P: n/a
On Mar 25, 8:30 am, "Eric Layman" <namyalcire[at no spam]gmail.com>
wrote:
Hi,

What's the difference between a normal web element:

<input type="text" id="txtname" name="txtname" runat="server">

vs webcontrol text box:

<asp:Textbox id="username" Columns="10" runat="server">
</asp:TextBox>

When should we use the normal input text box and when should we use the asp
textbox?

please advise.

Thanks.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

All Asp.net server controls eventually translated to html elements
when the page gets rendered...
Asp.net server controls provide more user friendly programming
environment...
for instance developers are use to access a Text Field by Control.Text
Property...
but in html you got to access via control.value ...
when control.Text is more meaning full... in programming a
application...

Thanks...
Masudur

Mar 24 '07 #2

P: n/a
Overall, I would use the asp.net server controls most of the time. The only
time I would go against that rule is when I have controls that I am using
more on the client side and only collecting data from in a large pull (the
entire form). I would also be careful to pick forms that are unlikely to
become more complex and need a lot of handling on the server side. WHile you
can handle HTML controls (runat="server"), they are not as rich.

The HTML controls were included, primarily, to allow an easy transition from
traditional ASP and other "legacy" technologies to ASP.NET. It is very rare
you will use the HTML controls.

If you need a lot of client side customization, through JavaScript, the HTML
controls are a bit easier to work with, but you can emit JavaScript from the
server side, so this is only marginally easier to do. And, is it worth the
sacrifice?

I would also consider HTML controls if your developers are not skilled in
web server controls, as they map to the HTML elements. But, you may
sacrifice some of the rich user interface heading this direction, so use
this reason with caution. Is the slightly lower learning curve worth the
sacrifice?

In ASP.NET 1.x, the story was a bit different, and I could see more reasons
to use the HTML controls. With 2.0, I will have to think hard to come up
with a really good reason.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
"Eric Layman" <namyalcire[at no spam]gmail.comwrote in message
news:11************@sp6iad.superfeed.net...
Hi,

What's the difference between a normal web element:

<input type="text" id="txtname" name="txtname" runat="server">

vs webcontrol text box:

<asp:Textbox id="username" Columns="10" runat="server">
</asp:TextBox>

When should we use the normal input text box and when should we use the
asp textbox?

please advise.

Thanks.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 24 '07 #3

P: n/a

Hi,

Thanks for the reply.

Do u mind explaning why .NET 1.1 is different?

Right now the client is using net 1.1 for a public website.

Although I have configured my IIS to run .net 1.1, what are the pitfalls i
should watch out for?

Im using .net server controls at the moment.

Right now its a battle between building using classic asp vs dotnet.

I've just experimented with dotnet recently and Im pretty pleased by the
results. Complex task can be handled in a small amount of time!


"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:CA**********************************@microsof t.com...
Overall, I would use the asp.net server controls most of the time. The
only time I would go against that rule is when I have controls that I am
using more on the client side and only collecting data from in a large
pull (the entire form). I would also be careful to pick forms that are
unlikely to become more complex and need a lot of handling on the server
side. WHile you can handle HTML controls (runat="server"), they are not as
rich.

The HTML controls were included, primarily, to allow an easy transition
from traditional ASP and other "legacy" technologies to ASP.NET. It is
very rare you will use the HTML controls.

If you need a lot of client side customization, through JavaScript, the
HTML controls are a bit easier to work with, but you can emit JavaScript
from the server side, so this is only marginally easier to do. And, is it
worth the sacrifice?

I would also consider HTML controls if your developers are not skilled in
web server controls, as they map to the HTML elements. But, you may
sacrifice some of the rich user interface heading this direction, so use
this reason with caution. Is the slightly lower learning curve worth the
sacrifice?

In ASP.NET 1.x, the story was a bit different, and I could see more
reasons to use the HTML controls. With 2.0, I will have to think hard to
come up with a really good reason.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
"Eric Layman" <namyalcire[at no spam]gmail.comwrote in message
news:11************@sp6iad.superfeed.net...
>Hi,

What's the difference between a normal web element:

<input type="text" id="txtname" name="txtname" runat="server">

vs webcontrol text box:

<asp:Textbox id="username" Columns="10" runat="server">
</asp:TextBox>

When should we use the normal input text box and when should we use the
asp textbox?

please advise.

Thanks.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 24 '07 #4

P: n/a
With classic asp, you for the most part you need to reload the page each
time you need data from the server or want to send data to the server. With
asp.net using server controls you can do no without reloading the page. That
is the biggest advantage as far as I'm concerned in using asp.net.

I myself like to use System.Web.UI.ICallbackEventHandler to send and
receive data to and from the server

--
Dim Alan as ThatsIT.net.au.Staffmember
Alan.signature = "Thank You"
Response.Write Alan.signature.toString()
__________________________________________

"Eric Layman" <namyalcire[at no spam]gmail.comwrote in message
news:11************@sp6iad.superfeed.net...
>
Hi,

Thanks for the reply.

Do u mind explaning why .NET 1.1 is different?

Right now the client is using net 1.1 for a public website.

Although I have configured my IIS to run .net 1.1, what are the pitfalls i
should watch out for?

Im using .net server controls at the moment.

Right now its a battle between building using classic asp vs dotnet.

I've just experimented with dotnet recently and Im pretty pleased by the
results. Complex task can be handled in a small amount of time!


"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:CA**********************************@microsof t.com...
>Overall, I would use the asp.net server controls most of the time. The
only time I would go against that rule is when I have controls that I am
using more on the client side and only collecting data from in a large
pull (the entire form). I would also be careful to pick forms that are
unlikely to become more complex and need a lot of handling on the server
side. WHile you can handle HTML controls (runat="server"), they are not
as rich.

The HTML controls were included, primarily, to allow an easy transition
from traditional ASP and other "legacy" technologies to ASP.NET. It is
very rare you will use the HTML controls.

If you need a lot of client side customization, through JavaScript, the
HTML controls are a bit easier to work with, but you can emit JavaScript
from the server side, so this is only marginally easier to do. And, is it
worth the sacrifice?

I would also consider HTML controls if your developers are not skilled in
web server controls, as they map to the HTML elements. But, you may
sacrifice some of the rich user interface heading this direction, so use
this reason with caution. Is the slightly lower learning curve worth the
sacrifice?

In ASP.NET 1.x, the story was a bit different, and I could see more
reasons to use the HTML controls. With 2.0, I will have to think hard to
come up with a really good reason.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
"Eric Layman" <namyalcire[at no spam]gmail.comwrote in message
news:11************@sp6iad.superfeed.net...
>>Hi,

What's the difference between a normal web element:

<input type="text" id="txtname" name="txtname" runat="server">

vs webcontrol text box:

<asp:Textbox id="username" Columns="10" runat="server">
</asp:TextBox>

When should we use the normal input text box and when should we use the
asp textbox?

please advise.

Thanks.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 24 '07 #5

P: n/a
Well, you missed the most important difference between the two...

Web Form controls are server controls, which means that they are instances
of classes created on the web server. As such, they can be programmed by
your server-side code.

HTML Form controls are simply the standard, client-side, controls of the
HTML language and must be programmed only with client-side code.

This main diiference has many implacations for performance and scalability.
"Masudur" <mu*****@gmail.comwrote in message
news:11**********************@p15g2000hsd.googlegr oups.com...
On Mar 25, 8:30 am, "Eric Layman" <namyalcire[at no spam]gmail.com>
wrote:
>Hi,

What's the difference between a normal web element:

<input type="text" id="txtname" name="txtname" runat="server">

vs webcontrol text box:

<asp:Textbox id="username" Columns="10" runat="server">
</asp:TextBox>

When should we use the normal input text box and when should we use the
asp
textbox?

please advise.

Thanks.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com


All Asp.net server controls eventually translated to html elements
when the page gets rendered...
Asp.net server controls provide more user friendly programming
environment...
for instance developers are use to access a Text Field by Control.Text
Property...
but in html you got to access via control.value ...
when control.Text is more meaning full... in programming a
application...

Thanks...
Masudur

Mar 24 '07 #6

P: n/a
"Scott M." <s-***@nospam.nospamwrote in message
news:Oh**************@TK2MSFTNGP02.phx.gbl...
HTML Form controls are simply the standard, client-side, controls of the
HTML language and must be programmed only with client-side code.
Utter rubbish!

<input type="text" id="MyTextBox" run="server" value="Hello" />

protected void Page_Load(object sender, EventArgs e)
{
MyTextBox.Visible = false;
}
Mar 24 '07 #7

P: n/a
Not at all!

I noticed you added: run="server" (it should actually be runat="server", by
the way), but by doing that, you have changed the control from an HTML Form
Element to a .NET HTML Server control (which is then represented by a
server-side class and does give the object server-side programmability.).
Thus, you provided a response that has nothing to do with the question or my
reply.

Do you see the subject of this thread: "what's the difference between a
normal form element and a web control element?"?

An HTML Server Control (runat="server") is not a "normal form element", it
is a web control. So, basically, your response is comparing a web control
to a web control, not a normal HTML form element to a web control.

-Scott

"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
"Scott M." <s-***@nospam.nospamwrote in message
news:Oh**************@TK2MSFTNGP02.phx.gbl...
>HTML Form controls are simply the standard, client-side, controls of the
HTML language and must be programmed only with client-side code.

Utter rubbish!

<input type="text" id="MyTextBox" run="server" value="Hello" />

protected void Page_Load(object sender, EventArgs e)
{
MyTextBox.Visible = false;
}

Mar 24 '07 #8

P: n/a
"Scott M." <s-***@nospam.nospamwrote in message
news:OX*************@TK2MSFTNGP06.phx.gbl...
runat="server", by the way)
You're quite right - well done for picking that up...
Mar 24 '07 #9

P: n/a
The OP is asking about the difference of the server controls. Look at
the code he presented as examples.

If you ignore the examples because you think that they are incorrect,
and only answer the question in the subject, I think that you should say
so. Otherwise your reply only adds confusion to the thread.

Scott M. wrote:
Well, you missed the most important difference between the two...

Web Form controls are server controls, which means that they are instances
of classes created on the web server. As such, they can be programmed by
your server-side code.

HTML Form controls are simply the standard, client-side, controls of the
HTML language and must be programmed only with client-side code.

This main diiference has many implacations for performance and scalability.
"Masudur" <mu*****@gmail.comwrote in message
news:11**********************@p15g2000hsd.googlegr oups.com...
>On Mar 25, 8:30 am, "Eric Layman" <namyalcire[at no spam]gmail.com>
wrote:
>>Hi,

What's the difference between a normal web element:

<input type="text" id="txtname" name="txtname" runat="server">

vs webcontrol text box:

<asp:Textbox id="username" Columns="10" runat="server">
</asp:TextBox>

When should we use the normal input text box and when should we use the
asp
textbox?

please advise.

Thanks.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

All Asp.net server controls eventually translated to html elements
when the page gets rendered...
Asp.net server controls provide more user friendly programming
environment...
for instance developers are use to access a Text Field by Control.Text
Property...
but in html you got to access via control.value ...
when control.Text is more meaning full... in programming a
application...

Thanks...
Masudur


--
Göran Andersson
_____
http://www.guffa.com
Mar 25 '07 #10

P: n/a
Eric Layman wrote:
Hi,

What's the difference between a normal web element:

<input type="text" id="txtname" name="txtname" runat="server">

vs webcontrol text box:

<asp:Textbox id="username" Columns="10" runat="server">
</asp:TextBox>

When should we use the normal input text box and when should we use the asp
textbox?

please advise.

Thanks.
An html element with runat="server" will be parsed into a server control
in the System.Web.UI.HtmlControls namespace.

These are server controls that directly correspond to the html elements
that will end up in the final page. It gives you access to the
properties of the control from the server code, but it doesn't add the
rich functionality of the web controls. A control like this does not
require a form with runat="server" to work.

A server control with the asp: prefix will be parsed into a server
control in the System.Web.UI.WebControls namespace.

These are rich controls that can use ViewState to retain values between
postbacks, and offer you events to handle the result of the user
actions. A web control might not exactly correspond to a single html
element in the page, but may render several elements, or even none at
all. A web control that uses ViewState has to be placed in a form with
runat="server".

--
Göran Andersson
_____
http://www.guffa.com
Mar 25 '07 #11

P: n/a
I'll be honest with you Goran and tell you that I didn't notice the
runat=server in the first post. My response was based on the subject and
the <INPUTvs. <ASP:>
"Göran Andersson" <gu***@guffa.comwrote in message
news:ud**************@TK2MSFTNGP02.phx.gbl...
The OP is asking about the difference of the server controls. Look at the
code he presented as examples.

If you ignore the examples because you think that they are incorrect, and
only answer the question in the subject, I think that you should say so.
Otherwise your reply only adds confusion to the thread.

Scott M. wrote:
>Well, you missed the most important difference between the two...

Web Form controls are server controls, which means that they are
instances of classes created on the web server. As such, they can be
programmed by your server-side code.

HTML Form controls are simply the standard, client-side, controls of the
HTML language and must be programmed only with client-side code.

This main diiference has many implacations for performance and
scalability.
"Masudur" <mu*****@gmail.comwrote in message
news:11**********************@p15g2000hsd.googleg roups.com...
>>On Mar 25, 8:30 am, "Eric Layman" <namyalcire[at no spam]gmail.com>
wrote:
Hi,

What's the difference between a normal web element:

<input type="text" id="txtname" name="txtname" runat="server">

vs webcontrol text box:

<asp:Textbox id="username" Columns="10" runat="server">
</asp:TextBox>

When should we use the normal input text box and when should we use the
asp
textbox?

please advise.

Thanks.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

All Asp.net server controls eventually translated to html elements
when the page gets rendered...
Asp.net server controls provide more user friendly programming
environment...
for instance developers are use to access a Text Field by Control.Text
Property...
but in html you got to access via control.value ...
when control.Text is more meaning full... in programming a
application...

Thanks...
Masudur



--
Göran Andersson
_____
http://www.guffa.com

Mar 25 '07 #12

P: n/a
The answer to your question is in my FAQ.
Here I have summarized the difference between HTML controls ("web elements"
as you call them) and web controls:
http://SteveOrr.net/faq/3in1.aspx#HTMLvsWeb

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Eric Layman" <namyalcire[at no spam]gmail.comwrote in message
news:11************@sp6iad.superfeed.net...
Hi,

What's the difference between a normal web element:

<input type="text" id="txtname" name="txtname" runat="server">

vs webcontrol text box:

<asp:Textbox id="username" Columns="10" runat="server">
</asp:TextBox>

When should we use the normal input text box and when should we use the
asp textbox?

please advise.

Thanks.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 27 '07 #13

This discussion thread is closed

Replies have been disabled for this discussion.