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

M

Masudur

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.


----------------------------------------------------------

----------------------------------------------------------
color]


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
 
C

Cowboy \(Gregory A. Beamer\)

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!
*********************************************
 
T

ThatsIT.net.au

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 said:
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!
 
S

Scott M.

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 said:
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.


----------------------------------------------------------

----------------------------------------------------------
color]


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
 
M

Mark Rae

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;
}
 
S

Scott M.

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
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

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.
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 said:
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.


----------------------------------------------------------

----------------------------------------------------------
color]

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
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Eric said:
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".
 
E

Eric Layman

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.
 
E

Eric Layman

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) said:
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 said:
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.
 
S

Scott M.

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 <INPUT> vs. <ASP:>


Göran Andersson said:
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.
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 said:
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.


----------------------------------------------------------

----------------------------------------------------------
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top