复合控件

RadioButtonList --单选

RadioButtonList1.DataSource = 等于一个集合   -- 指向数据源 

RadioButtonList1.DataTextField = "NationName";   -- 网页中显示的内容                                                                        

RadioButtonList1.DataValueField = "NationCode";  -- 给机器看的的内容                                                                         

RadioButtonList1.DataBind();              -- 不加这句绑不上数据

一共4个属性

enable

select

text

value

CheckBoxList  --多选

CheckBoxList1.SelectedItem.Text --取值

AutopostBack = " true ";         自动提交

DropDownList     --下拉

取值一样

page_load事件在每一次页面刷新的时候都会执行,会把数据重新绑定一次,再去执行按钮事件

判断页面是否是第一次加载还是响应回发

 if( ispostback == false  )  {       第一次加载  }  //很重要  95%要写在这里面

事件的委托不能写在这里面

    响应回发

跨页面传值

Response.Redirect("url。aspx?a=值"); a自定义名称  不能加空格

接收一个string类型 

string s=Request[a];

s就是传过来的值

原文地址:https://www.cnblogs.com/v587yy/p/6883402.html