C# 在服务器端获取组合框的选定值
我的查询是,我的表单中有一个html格式的组合框,我想将组合框中所选项目的值传递给服务器端,这是一个aspx页面C# 在服务器端获取组合框的选定值,c#,javascript,asp.net,html,C#,Javascript,Asp.net,Html,我的查询是,我的表单中有一个html格式的组合框,我想将组合框中所选项目的值传递给服务器端,这是一个aspx页面 <form method="POST" action="page.aspx"> <input id="customerName" name="customerName" type="Text" /> <input id="customerPhone" name="customerPhone" type="Text" /> &
<form method="POST" action="page.aspx">
<input id="customerName" name="customerName" type="Text" />
<input id="customerPhone" name="customerPhone" type="Text" />
<select id="combobox" >
<option>df</option>
<option>as</option>
</select>
<input
</form>
value="Save" type="Submit" />
但是如何获得组合框中的选定值呢
请帮帮我
提前感谢您可以尝试修复html:
<form method="POST" action="page.aspx">
<input id="customerName" name="customerName" type="text">
<input id="customerPhone" name="customerPhone" type="text">
<select id="combobox" name="combobox">
<option value="df">df</option>
<option value="as">as</option>
</select>
<input value="Save" type="submit">
</form>
df
作为
所选值将作为
请求发布。表单['combobox']
请检查您将获得selectedValue请求。表单['customerName']您的选择元素需要名称;表单被键入name属性。添加name=“MyComboBox”这样的名称,然后请求。表单[“MyComboBox”]应该为您提供值。出于兴趣,为什么不使用
<form method="POST" action="page.aspx">
<input id="customerName" name="customerName" type="text">
<input id="customerPhone" name="customerPhone" type="text">
<select id="combobox" name="combobox">
<option value="df">df</option>
<option value="as">as</option>
</select>
<input value="Save" type="submit">
</form>