繁体中文
设为首页
加入收藏
当前位置:.Net技术首页 >> Asp.Net开发 >> dpc:Creating a DataBound List of Radio Buttons--预览页面source code[等级:中]

dpc:Creating a DataBound List of Radio Buttons--预览页面source code[等级:中]

2007-08-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介: Sub Page_Load(sender as Object, e as EventArgs) If Not Page.IsPostBack then BindData() End If End Sub Sub BindData() '1. Create a connection Dim myConnection as New SqlConnection(ConfigurationS...

<% @Import Namespace="System.Data" %>

<% @Import Namespace="System.Data.SqlClient" %>

Radio Button List Demo

This demo illustrates how to use data-binding to dynamically

create a radio button list based on database information.

The data below is from the

Sample Chapters Database.

First, the radio button list is bound to the tblPublishers table. Then,

when you select a publisher, a DataGrid Web control is populated with

the books provided by the selected publisher. (Adding paging to the DataGrid would be

a snap. Just read: Paing

Database Results in ASP.NET!)


Choose a Publisher's Books to View

DataValueField="PublisherID" DataTextField="Name" />


Text="View Published Books" OnClick="btnViewBooks_Click" />

Font-Size="Large" Font-Bold="True" />

Font-Name="Verdana" Font-Size="Smaller"

HeaderStyle-BackColor="Purple" HeaderStyle-ForeColor="White"

HeaderStyle-Font-Size="Small" HeaderStyle-Font-Bold="True"

AutoGenerateColumns="False">

DataField="Title" />

DataField="Description" />

责任编辑:admin
相关文章