我在页面的Page_Load 中加入了以下语句:
Button1.OnClientClick = "window.open('search.aspx?type=' + document.getElementById('" + TextBox1.ClientID + "').value,'_blank');return false;"; 它能正确地获得TextBox1的值并进行传递,现在我想获取CheckBoxList RadioButtonList 中的值该怎么办,而且这句话只是传递了一个参数,要传递多个参数该怎么写,小弟愚钝呀,不会弄~~~
Button1.OnClientClick = "window.open('search.aspx?type=' + document.getElementById('" + TextBox1.ClientID + "').value,'_blank');return false;"; 它能正确地获得TextBox1的值并进行传递,现在我想获取CheckBoxList RadioButtonList 中的值该怎么办,而且这句话只是传递了一个参数,要传递多个参数该怎么写,小弟愚钝呀,不会弄~~~
http://blog.csdn.net/jingshuaizh/archive/2008/03/14/2181384.aspx传递多个参数直接用 & 连接啊
RadioButtonList和DropDownList会好些
string queryScript = string.Format("window.open('search.aspx?type=' + document.getElementById('{0}').value + '&p2=' + document.getElementById('{1}').value,'_blank');return false;",
TextBox1.ClientID,
TextBox2.ClientID);
Button4.OnClientClick = queryScript;
{
if(this.CheckBoxList.Item[i].Selected)
{
Response.Write(this.CheckBox.Item[i].Text);
}
}
要传多个值第一个值后面加个"&"再加你的参数就OK
要判断哪些被选中
可能要传很多个参数RadioButtonList比较方便 只要传一个值