1、aspx页面从.cs代码中的类型继承而来,因而前台可以访问后台public属性的数据和方法
2、数据绑定
a、<%#语句%>;示例,<%#string+'1'%>,后台代码中要有Page.DataBind()或者 控件.DataBind();Page类的方法DataBind()调用是对Page子类的所有控件的同方法调用,作用是使<%#string+'1'%>表达式出现结果;string是后台代码.cs文件中的一个变量;
b、后台代码设置控件属性 示例,this.TextBox1.text="数据绑定";
c、对控件设置数据源
3、为DropDownList设置数据源
System.Collections.ArrayList arraylist_sex = new System.Collections.ArrayList();
arraylist_sex.Add("男");
arraylist_sex.Add("女");
DropDownList1.DataSource = arraylist_sex;
DropDownList1.DataBind();