在HTML頁面中就一個按鈕
//////<asp:button id=
Text=
///</asp:button>
和 一個DataGrid
///<asp:datagrid id=
///</asp:datagrid>
aspx
////public class WebForm
{
protected System
protected System
private void Page_Load(object sender
{
DataGrid
DataGrid
// 在此處放置用戶代碼以初始化頁面
}
ICollection CreateDataSource()
{
DataTable dt = new DataTable();
DataRow dr;
dt
dt
dt
dt
for (int i =
{
dr = dt
dr[
dr[
dr[
dr[
dt
}
DataView dv = new DataView(dt);
return dv;
}
private void Button
{
Response
Response
Response
Response
Response
Response
this
System
System
System
this
Response
Response
}
private void DataGrid
{
if(e
{
e
e
}
}
#region Web 窗體設計器生成的代碼
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 該調用是 ASP
//
InitializeComponent();
base
}
/// <summary>
/// 設計器支持所需的方法
/// 此方法的內容
/// </summary>
private void InitializeComponent()
{
this
this
this
}
#endregion
}
From:http://tw.wingwit.com/Article/program/net/201311/12899.html