如何在后台(C#)获取select 的值
能不能给个具体的例子呢?
要详细点的说明
[解决办法]
- HTML code
<select id="select1" runnat="server" ><option />...</select>
[解决办法]
前台:
- HTML code
<select name="list"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select>
[解决办法]
添加 runnat="server"
后台就可以访问到该控件啦
[解决办法]
放个 隐藏域 然后前台用js 脚本 给隐藏域赋值
[解决办法]
this.select.SelectedValue 就可以在服务端获取值了
[解决办法]
[解决办法]
<select id="sel_Company" style="width: 140px" runat="server" </select>
后台获取:string c=Request["sel_Company"];
[解决办法]
[解决办法]
[解决办法]
this.select.value
[解决办法]
<select name ="xx">
<option value="1">11111111</option>
<option value="2">22222222</option>
<option value="3">33333333</option>
<option value="4">44444444</option>
</select>
string xx= Request.Form.Get("xx");
xx是获得选择中的Value