asp.net c#有没有办法 在后台cs代码里 直接 得到
前置aspx的 页面的 select的下拉框的值 (web页面)
(ajax可以做到 但当前cs逻辑ajax用太多。 思考如果能用在后台cs代码里 直接 得到 前置aspx的 页面的 select的下拉框的值
这个方法是最好的 )
------解决方案--------------------------------------------------------
用服务器控件啊!
<asp:DropDownList ID="ddlIsDaoHang" runat="server" Width="128px">
<asp:ListItem Value="0">是</asp:ListItem>
<asp:ListItem Value="1">否</asp:ListItem>
</asp:DropDownList>
后台获取 string id= ddlIsDaoHang.SelectedValue;
------解决方案--------------------------------------------------------
<select id="citysel" name="citysel">
<option value="1"> ....</option>
Request.Params.Get("citysel")
------解决方案--------------------------------------------------------
html空间的下拉,我一般把他取值放在一个文本框里,然后去文本框的值
- HTML code
<input ID="tbedu" runat="server" name="tbedu" type="text"><select id="ddledu" name="ddledu" onchange="document.getElementById('tbedu').value=this.options[this.selectedIndex].text" runat="server" tabindex="-1"></select>
------解决方案--------------------------------------------------------
- C# code
<div style="margin-top: 1px; height: 22px"> <input ID="tbedu" runat="server" style="width: 84px; position: absolute; height: 20px" class="pin" name="tbedu" type="text"> <select style="width: 100px; clip: rect(auto auto auto 83px); position: absolute; height: 20px" id="ddledu" name="ddledu" onchange="document.getElementById('tbedu').value=this.options[this.selectedIndex].text" runat="server" tabindex="-1"> </select> </div>