
We may use data binding to fill lists with selectable items from an imported data source, like a database, an XML file, or a script. Data Binding The following controls are list controls which support data binding: asp:RadioButtonList asp:CheckBoxList asp:DropDownList asp:Listbox The selectable items in each of the above controls are usually defined by one [...]
Read More >>

Create an ArrayList The ArrayList object is a collection of items containing a single data value. Items are added to the ArrayList with the Add() method. The following code creates a new ArrayList object named mycountries and four items are added: <script runat=”server”> Sub Page_Load if Not Page.IsPostBack then dim mycountries=New ArrayList mycountries.Add(“Norway”) mycountries.Add(“Sweden”) mycountries.Add(“France”) [...]
Read More >>

Create a Hashtable The Hashtable object contains items in key/value pairs. The keys are used as indexes, and very quick searches can be made for values by searching through their keys. Items are added to the Hashtable with the Add() method. The following code creates a Hashtable named mycountries and four elements are added: <script [...]
Read More >>

The SortedList Object The SortedList object contains items in key/value pairs. A SortedList object automatically sort the items in alphabetic or numeric order. Items are added to the SortedList with the Add() method. A SortedList can be sized to its final size with the TrimToSize() method. The following code creates a SortedList named mycountries and [...]
Read More >>

We can bind an XML file to a list control. An XML File Here is an XML file named “countries.xml”: <?xml version=”1.0″ encoding=”ISO-8859-1″?> <countries> <country> <text>Norway</text> <value>N</value> </country> <country> <text>Sweden</text> <value>S</value> </country> <country> <text>France</text> <value>F</value> </country> <country> <text>Italy</text> <value>I</value> </country> </countries> Take a look at the XML file: countries.xml Bind a DataSet to a List Control [...]
Read More >>

The Repeater control is used to display a repeated list of items that are bound to the control. Bind a DataSet to a Repeater Control The Repeater control is used to display a repeated list of items that are bound to the control. The Repeater control may be bound to a database table, an XML [...]
Read More >>

The DataList control is, like the Repeater control, used to display a repeated list of items that are bound to the control. However, the DataList control adds a table around the data items by default. Bind a DataSet to a DataList Control The DataList control is, like the Repeater control, used to display a repeated [...]
Read More >>

All server controls must appear within a <form> tag, and the <form> tag must contain the runat=”server” attribute. ASP.NET Web Forms All server controls must appear within a <form> tag, and the <form> tag must contain the runat=”server” attribute. The runat=”server” attribute indicates that the form should be processed on the server. It also indicates [...]
Read More >>

Server controls are tags that are understood by the server. Limitations in Classic ASP The listing below was copied from the previous chapter: <html> <body bgcolor=”yellow”> <center> <h2>Hello W3Schools!</h2> <p><%Response.Write(now())%></p> </center> </body> </html> The code above illustrates a limitation in Classic ASP: The code block has to be placed where you want the output to [...]
Read More >>

A simple ASP.NET page looks just like an ordinary HTML page. Hello W3Schools To start learning ASP.NET, we will construct a very simple HTML page that will display “Hello W3Schools” in an Internet browser like this: Hello W3Schools! Hello W3Schools in HTML This code displays the example as an HTML page: <html> [...]
Read More >>