日期:2014-05-17  浏览次数:20434 次

DropDownList控件怎样向另一页面传参数?谢谢
是个考试系统、考试时需要选择专业、如何把选定专业传到另一页面。
我用DropDownList绑定了数据源、
  string strsql="select * from ProfessionType";
  DataSet ds = DB.FillDataSet(strsql, "type");
  this.DropDownList1.DataSource = ds.Tables["type"];
  this.DropDownList1.DataTextField="profName";
  this.DropDownList1.DataValueField = "profID";
  this.DropDownList1.DataBind();

另一页面需要根据选择的专业id、来选择考试类型。这个参数怎样传的?
请大侠指导指导、在这里谢了!

------解决方案--------------------
是直接选择了跳转还是怎样 如果是跳转的话就直接写到 selectindexchange 事件里咯!

------解决方案--------------------
用个int num接住你选择的下拉框的ID Response.Redirect("跳转页?ddlID=" +num);
另外那个页面(Request.QueryString["ddlID"])获取传过来的ID
------解决方案--------------------
先得到要传的值,然后在跳转的时候以url的形式传过去不行么?
------解决方案--------------------
C# code

String strProfessionType=DropDownList1.SelectedValue;
Response.Redirect("a.aspx?ProfessionType=" +strProfessionType);

------解决方案--------------------
你这个所谓的专业数据不是什么 特殊的字段 
不存在保密
完全可以在change事件里面 指定跳转的时候把 seletevalue 或者 seletename都传过去