Professional Web Applications Themes

Question on HTML and Web(Server Side) Controls - ASP.NET Building Controls

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

  1. #1

    Default Question on HTML and Web(Server Side) Controls

    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

    [url]www.consiliumsoft.com[/url]
    Use the START button? Then you need CSFastRunII...
    A new kind of application launcher integrated in the taskbar!
    ScreenShot - [url]http://www.consiliumsoft.com/ScreenShot.jpg[/url]
    Ralph Krausse Guest

  2. #2

    Default Re: Question on HTML and Web(Server Side) Controls

    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>
    WebControls such as Button offer a higher level abstraction than HTML
    controls. See for example the way you set each button's text. For the HTML
    control, you use its HTML attributes like "value" (which isn't terribly
    self-describing to developers not familiar with HTML), whereas the
    WebControl uses a property called "Text". If you wanted to set the button's
    color, you can simply set the Button.Color to an object of type Color. No
    such luck with <input />, where you have to dig out your HTML/CSS reference
    to set the style attribute to some CSS value.

    There are also WebControls that are a combination of many HTML elements,
    like the DataGrid, and do not have any counterparts as HTML controls.

    Which to use? That's an architectural question. When you have a lot existing
    HTML that you want to beef up with some server-side logic, HTML controls
    will get you started quickly, because you can add runt="server" to your
    existing pages and off you go. If you start from scratch, check which
    controls fulfill your requirements best. Note that you can easily mix both
    control families in your pages.

    Cheers,

    --
    Joerg Jooss
    [email]joerg.joossgmx.net[/email]


    Joerg Jooss Guest

Similar Threads

  1. Embeding html controls in Server Control
    By Raj Dhrolia in forum ASP.NET Building Controls
    Replies: 0
    Last Post: December 22nd, 02:45 AM
  2. Any way to include an HTML form with server-side controls?
    By paul.hester@gmail.com in forum ASP.NET Building Controls
    Replies: 0
    Last Post: September 5th, 06:19 AM
  3. Controls with a client side onLoad function or seting a cursor server side
    By Geoff Davis in forum ASP.NET Building Controls
    Replies: 3
    Last Post: January 15th, 03:54 AM
  4. Server side automation question
    By Arthur Hastings in forum ASP
    Replies: 2
    Last Post: October 24th, 09:17 PM
  5. IIS server side script question
    By Pete Lux in forum ASP
    Replies: 1
    Last Post: September 10th, 11:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139