DropDownList1启用了autopostback,
DropDownList2取消了autopostback,
现在DropDownList2能根据DropDownList1的值来读取数据,
但是无论怎么选Response.Write(DropDownList2.SelectedItem.Text) 显示出来的值总是DropDownList2里面的第一项
大神们,到底是哪里出问题啦???
DropDownList2取消了autopostback,
现在DropDownList2能根据DropDownList1的值来读取数据,
但是无论怎么选Response.Write(DropDownList2.SelectedItem.Text) 显示出来的值总是DropDownList2里面的第一项
大神们,到底是哪里出问题啦???
解决方案 »
- 64位win7系统下 VS2005运行问题
- js控制Iframe打开指定窗口
- ------------------反编译与混淆--------------
- 接触Ajxa不久,实现对比客户端控件和服务器控件的区别 。
- 如何不利用FileUpload实现上传文件的功能?
- asp.net有没有象asp里rs.addnew这样的添加数据代码?
- 存储过程返回值 怎么老是0?晕死,
- 在线等 关于datalist问题
- 问个.net2005 自定义分页的问题
- csharpboy,我看了你给的读硬件信息的那段代码,可有关于WQL的资料?
- detailsview里嵌入一个Button怎么让button点击一次后变灰不能再点击
- 关于lodop 打印控件使用的问题
{
itemBLL ib = new itemBLL();
memberBLL mb = new memberBLL();
applyBLL ab = new applyBLL();
protected void Page_Load(object sender, EventArgs e)
{
string mname = DropDownList1.SelectedValue.ToString();
DropDownList2.DataSource = ib.getallitem(mname);
DropDownList2.DataTextField = "item";
DropDownList2.DataValueField = "item";
DropDownList2.DataBind();
string id = Session["id"].ToString();
register r = mb.SelectRecordByid(id);
TextBox1.Text = r.name;
TextBox2.Text = r.id;
TextBox3.Text = r.sex;
TextBox4.Text = r.birthday.ToString();
}
protected void Button6_Click(object sender, EventArgs e)
{
apply a = new apply();
a.mname = DropDownList1.SelectedItem.Text;
a.item = DropDownList2.SelectedItem.Text;
a.name = TextBox1.Text;
a.id = TextBox2.Text;
a.sex = TextBox3.Text;
a.birthday =DateTime.Parse(TextBox4.Text);
a.phone = TextBox5.Text;
a.team = TextBox6.Text;
ab.Insertapply(a);
Response.Write("<script>alert('报名成功!');</script>");
}
}
{
if(!IsPostBack)
{
string mname = DropDownList1.SelectedValue.ToString();
DropDownList2.DataSource = ib.getallitem(mname);
DropDownList2.DataTextField = "item";
DropDownList2.DataValueField = "item";
DropDownList2.DataBind();
string id = Session["id"].ToString();
register r = mb.SelectRecordByid(id);
TextBox1.Text = r.name;
TextBox2.Text = r.id;
TextBox3.Text = r.sex;
TextBox4.Text = r.birthday.ToString();
}
}
http://www.cnblogs.com/insus/archive/2013/05/10/3070348.html
http://www.cnblogs.com/insus/archive/2012/10/16/2725307.html
http://www.cnblogs.com/insus/archive/2011/07/04/2097059.html