zl程序教程

您现在的位置是:首页 >  后端

当前栏目

Csharp:asp.net CheckBoxList databind

NetASP csharp
2023-09-11 14:19:12 时间
/style
 asp:CheckBoxList ID="CheckBoxList1" runat="server" RepeatDirection="Horizontal" AppendDataBoundItems="True" DataTextField="B_Name" DataValueField="B_EnglishName" RepeatColumns="6" CellPadding="5"

 CellSpacing="5" RepeatLayout="Table" Border Css 

 /asp:CheckBoxList br / 

 asp:Button ID="Button1" runat="server" Text="確定" / /div 

/// summary 

 /// CheckBoxList數據源

 /// 塗聚文

 /// 20130705

 /// 

 /// /summary 

 private void setCheckBoxList()

 DataTable dt = new DataTable();

 CheckBoxList1.Items.Clear();

 dt = geovindu_branchBLL.SelectGeovindu_branchNameDt();

 CheckBoxList1.DataSource = dt;

 this.CheckBoxList1.DataTextField = "B_Name";

 this.CheckBoxList1.DataValueField = "B_EnglishName";

 CheckBoxList1.DataBind();

 /// summary 

 /// 

 /// /summary 

 /// param name="sender" /param 

 /// param name="e" /param 

 protected void Page_Load(object sender, EventArgs e)

 if (!IsPostBack)

 setCheckBoxList();


//傳值給父頁面 this.Page.Controls.Add(new LiteralControl(string.Format(" script opener.document.form1.txtShoppingDealsBranch.value={0} /script ", variable))); //關閉此視窗 this.Page.Controls.Add(new LiteralControl(" script window.close(); /script

geovindu 读者是,读之者,者之读.一沙一世界! to be is to do举世皆清我独浊,众人皆醒我独醉.俺是农民工,程序员.