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

Discussion in 'ASP .Net' started by Masudur, Mar 24, 2007.

  1. Masudur

    Masudur Guest

    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
     
    Masudur, Mar 24, 2007
    #1
    1. Advertising

  2. 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.com> wrote in message
    news:...
    > 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
     
    Cowboy \(Gregory A. Beamer\), Mar 24, 2007
    #2
    1. Advertising

  3. 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.com> wrote in message
    news:...
    >
    > 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)" <> wrote in
    > message news:...
    >> 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.com> wrote in message
    >> news:...
    >>> 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
     
    ThatsIT.net.au, Mar 24, 2007
    #3
  4. Masudur

    Scott M. Guest

    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" <> wrote in message
    news:...
    > 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
    >
     
    Scott M., Mar 24, 2007
    #4
  5. Masudur

    Mark Rae Guest

    "Scott M." <> wrote in message
    news:...

    > 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;
    }
     
    Mark Rae, Mar 24, 2007
    #5
  6. Masudur

    Scott M. Guest

    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" <> wrote in message
    news:%...
    > "Scott M." <> wrote in message
    > news:...
    >
    >> 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;
    > }
    >
     
    Scott M., Mar 24, 2007
    #6
  7. Masudur

    Mark Rae Guest

    "Scott M." <> wrote in message
    news:...

    > runat="server", by the way)


    You're quite right - well done for picking that up...
     
    Mark Rae, Mar 24, 2007
    #7
  8. Re: what's the difference between a normal form element and a webcontrol element?

    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" <> wrote in message
    > news:...
    >> 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
     
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Mar 25, 2007
    #8
  9. Re: what's the difference between a normal form element and a webcontrol element?

    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
     
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Mar 25, 2007
    #9
  10. Masudur

    Eric Layman Guest

    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
     
    Eric Layman, Mar 25, 2007
    #10
  11. Masudur

    Eric Layman Guest

    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)" <> wrote in
    message news:...
    > 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.com> wrote in message
    > news:...
    >> 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
     
    Eric Layman, Mar 25, 2007
    #11
  12. Masudur

    Scott M. Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message
    >> news:...
    >>> 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
     
    Scott M., Mar 25, 2007
    #12
  13. 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.com> wrote in message
    news:...
    > 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
     
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Mar 26, 2007
    #13
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jakk
    Replies:
    4
    Views:
    12,217
  2. =?Utf-8?B?UmFlZCBTYXdhbGhh?=

    Difference between casting by as and normal cast

    =?Utf-8?B?UmFlZCBTYXdhbGhh?=, Aug 15, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    415
    Brock Allen
    Aug 15, 2005
  3. tankbattle
    Replies:
    1
    Views:
    804
    George Bina
    Jul 21, 2006
  4. Johnny
    Replies:
    3
    Views:
    460
    Robert Kern
    Aug 23, 2005
  5. Deane
    Replies:
    3
    Views:
    1,188
    Deane
    Aug 1, 2007
Loading...

Share This Page