Question on HTML and Web(Server Side) Controls

Discussion in 'ASP .Net' started by Ralph Krausse, Sep 10, 2004.

  1. I know more html is needed to really produce this but enough is here
    for me to ask my question. So, this HTML code produce 2 buttons. One
    button is a HTML control and the other is ASP Web or Server Control.
    Why are there 2 ways to create buttons if they so the same thing? Do
    they do the same thing? In what senario would I use a HTML button
    rather than a Web control button. Does it matter? If not why 2
    different controls that do the same thing.

    <HTML>

    <form id="Form1" method="post" runat="server">

    <INPUT style="Z-INDEX: 101; LEFT: 104px; POSITION: absolute; TOP:
    40px" type="button" value="Button1" id="Button2" name="Button2"
    runat="server">

    <asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 104px; POSITION:
    absolute; TOP: 88px" runat="server" Text="Button2"></asp:Button>
    </form>

    </HTML>


    Thanks
    Ralph Krausse

    www.consiliumsoft.com
    Use the START button? Then you need CSFastRunII...
    A new kind of application launcher integrated in the taskbar!
    ScreenShot - http://www.consiliumsoft.com/ScreenShot.jpg
    Ralph Krausse, Sep 10, 2004
    #1
    1. Advertising

  2. Ralph Krausse

    SevDer Guest

    Ralph Krausse wrote:

    >I know more html is needed to really produce this but enough is here
    >for me to ask my question. So, this HTML code produce 2 buttons. One
    >button is a HTML control and the other is ASP Web or Server Control.
    >Why are there 2 ways to create buttons if they so the same thing? Do
    >they do the same thing? In what senario would I use a HTML button
    >rather than a Web control button. Does it matter? If not why 2
    >different controls that do the same thing.
    >
    ><HTML>
    >
    ><form id="Form1" method="post" runat="server">
    >
    ><INPUT style="Z-INDEX: 101; LEFT: 104px; POSITION: absolute; TOP:
    >40px" type="button" value="Button1" id="Button2" name="Button2"
    >runat="server">
    >
    ><asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 104px; POSITION:
    >absolute; TOP: 88px" runat="server" Text="Button2"></asp:Button>
    ></form>
    >
    ></HTML>
    >
    >
    >Thanks
    >Ralph Krausse
    >
    >www.consiliumsoft.com
    >Use the START button? Then you need CSFastRunII...
    >A new kind of application launcher integrated in the taskbar!
    >ScreenShot - http://www.consiliumsoft.com/ScreenShot.jpg
    >
    >

    For button it may be that you do not need web server control but
    generally web controls will enable you to write browser independent code
    (of course you can create little problems to yourself). And web controls
    by default has viewstate enabled so any changes on them are preserved in
    postbacks but if you are e.g. changing the text of the button, you need
    to run the client code to change it all the time or, in the Page_Load
    assing the value all the time. However if you have a web control you can
    assing it once and it will stay there as long as you don't change it
    agian. (A basic viewstate example)

    But again, most of the time, it will help you to write browser
    independent code as ASP.NET web controls handles this part for you.

    I hope it was not too complicated.



    --

    SevDer
    http://www.sevder.com
    SevDer, Sep 10, 2004
    #2
    1. Advertising

  3. Ralph Krausse

    Karl Guest

    What you are asking is why have System.Web.UI.WebControls and
    System.Web.UI.HtmlControls? Specifically, why have the overlapping
    controls?

    The WebControls tend to provide more flexibility and power from a
    development stand-point. They expose more properties, more events, and more
    functionality. That's their raison d'ĂȘtre.

    HtmlControls, exist because of how easily pure HTML/ASP can be converted to
    them. Add a runat="server" and an id="xxx" and you can program against them
    You won't have all the power of WebControls, but you'll get under way a lot
    quicker.


    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Ralph Krausse" <> wrote in message
    news:...
    > I know more html is needed to really produce this but enough is here
    > for me to ask my question. So, this HTML code produce 2 buttons. One
    > button is a HTML control and the other is ASP Web or Server Control.
    > Why are there 2 ways to create buttons if they so the same thing? Do
    > they do the same thing? In what senario would I use a HTML button
    > rather than a Web control button. Does it matter? If not why 2
    > different controls that do the same thing.
    >
    > <HTML>
    >
    > <form id="Form1" method="post" runat="server">
    >
    > <INPUT style="Z-INDEX: 101; LEFT: 104px; POSITION: absolute; TOP:
    > 40px" type="button" value="Button1" id="Button2" name="Button2"
    > runat="server">
    >
    > <asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 104px; POSITION:
    > absolute; TOP: 88px" runat="server" Text="Button2"></asp:Button>
    > </form>
    >
    > </HTML>
    >
    >
    > Thanks
    > Ralph Krausse
    >
    > www.consiliumsoft.com
    > Use the START button? Then you need CSFastRunII...
    > A new kind of application launcher integrated in the taskbar!
    > ScreenShot - http://www.consiliumsoft.com/ScreenShot.jpg
    Karl, Sep 10, 2004
    #3
    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. Matt
    Replies:
    14
    Views:
    4,096
    Chad Z. Hower aka Kudzu
    Jan 30, 2004
  2. =?Utf-8?B?c2lhag==?=
    Replies:
    7
    Views:
    1,478
    =?Utf-8?B?c2lhag==?=
    Mar 7, 2005
  3. Ralph Krausse

    Question on HTML and Web(Server Side) Controls

    Ralph Krausse, Sep 10, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    142
    Joerg Jooss
    Sep 11, 2004
  4. Ralph Krausse

    Question on HTML and Web(Server Side) Controls

    Ralph Krausse, Sep 10, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    105
    Ralph Krausse
    Sep 10, 2004
  5. brian

    HTML Server Controls vs Web Server Controls

    brian, Jan 21, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    307
    Steve C. Orr [MVP, MCSD]
    Jan 24, 2005
Loading...

Share This Page