Applied ASP .NET 4 in Context by Adam Freeman

Applied ASP .NET 4 in Context by Adam Freeman

Author:Adam Freeman
Language: eng
Format: epub, pdf
Publisher: Apress®
Published: 2011-09-02T16:00:00+00:00


Figure 18-6. A data-bound drop-down list

If you look at the HTML that the browser is displaying, you can see how Web Forms has mapped the data we defined when the control was rendered, as shown in Listing 18-6.

Listing 18-6. The HTML rendered by a data-bound DropDownList control

...

<select name="DropDownList1" id="DropDownList1">

<option value="Green">Apple</option>

<option value="Yellow">Banana</option>

<option value="Red">Cherry</option>

<option value="Red">Plum</option>

</select>...

You can see what I meant when I said how easy it is to add data to a Web Forms application. Admittedly, the example in this section is pretty simple, but as you will see, the basic pattern remains the same even when you're working with more complex data and controls.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.