asp.net  c#有没有办法 在后台cs代码里 直接 得到
 前置aspx的 页面的   select的下拉框的值   (web页面)(ajax可以做到 但当前cs逻辑ajax用太多。 思考如果能用在后台cs代码里 直接 得到  前置aspx的 页面的   select的下拉框的值 
这个方法是最好的  )

解决方案 »

  1.   

    前台 是一个   <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
    <select id="citysel">
    <option value="1"> ....</option>
    ...
    </select>
    后台          protected void Button1_Click(object sender, EventArgs e)         {             //---------------------------需要不用 ajax 能否 直接得到   客户端  select 的值???        
      

  2.   

       用服务器控件不行么?
       asp:dorpdownlist 直接就有下拉选择事件
      

  3.   

    用服务器控件啊!
      <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;
      

  4.   

    本帖最后由 net_lover 于 2012-04-26 16:52:59 编辑
      

  5.   

    html空间的下拉,我一般把他取值放在一个文本框里,然后去文本框的值
    <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>
    然后取  tbedu的值  tbedu.Value
      

  6.   


                           <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>