Using ASP.NET HTML Controls


We have been talking a lot about ASP.NET controls. A detailed discussion of each ASP.NET Server control goes beyond the scope of this book, but this discussion should get you familiarized with some key highlights of the controls. As previously mentioned, ASP.NET enriches HTML controls to be utilized in a server-based programming model. Table 8.1 presents a quick look at some of the HTML controls.

Table 8.1. ASP.NET HTML Controls

HTML SERVER CONTROL

DESCRIPTION

ABBREVIATED CODE SYNTAX

HtmlAnchor

Link control, corresponds to the HTML <a> tag

 <a id="id1" href="..." name="..."   OnServerClick="..."   runat="server">text</a> 

HtmlButton

Button control, corresponds to the HTML <button> tag

 <button id="..." OnServerClick="..."   runat="server">button text</button> 

HtmlForm

Form control, corresponds to the HTML <form> tag

 <form id="..." runat="server"> ... </form> 

HtmlGeneric

Maps to HTML controls not individually mapped by .NET; for example, <span>, <div>, and so on

 <span  div runat="server"> ... </span> 

HtmlImage

Image control, corresponds to the <img> tag

 <img id="..." src="..."  runat="server"/> 

HtmlInputButton

Input buttons , maps to the <input type="submitresetbutton"> HTML tags

 <input type="..." runat="server"/  OnServerClick="..."/> 

HtmlInputCheckBox

Check box, maps to the <input type="checkbox"> TML tag

 <input type="checkbox"  checked  runat="server"/> 

HtmlInputFile

File transfer control, maps to the <input type="file"> HTML tag

 <input type="file" runat="server"   accept="..." postedfile="..."/> 

HtmlInputHidden

Hidden input control, maps to the <input type="hidden"> HTML tag

 <input type="hidden" value=".."  runat="server"/> 

HtmlInputImage

Button with an image, maps to the <input type="image"> HTML tag

 <input type="image" src="..." OnServerClick="..." runat="server"/> 

HtmlInputRadioButton

Radio button, maps to <input type="radio">

 <input type="radio"  checked  name="..." runat="server"> 

HtmlInputText

Input text, maps to <input type="textpassword">

 <input type="textpassword"  size="..." value="..."  runat="server"/> 

HtmlSelect

List control, maps to the <select> HTML element

 <select OnServerChange="..."  DataSource="..."  runat="server">  <option>...</option> </select> 

HtmlTable, HtmlTableRow, HtmlTableCell

Maps to the HTML table/row/ cell

 <table rows="..." runat="server"  ...>  <tr>    <td>...</td>  </tr> </table> 

HtmlTextArea

Maps to the HTML text area

 <textarea runat="server" OnServerChange="..."> ... </textarea> 


Microsoft.Net Kick Start
Microsoft .NET Kick Start
ISBN: 0672325748
EAN: 2147483647
Year: 2003
Pages: 195
Authors: Hitesh Seth

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net