zoukankan      html  css  js  c++  java
  • 后台获取前台runat=server的select的值

    <li>
                <asp:Label ID="Lpro" runat="server" Text="省份:" CssClass="fixWidth"></asp:Label>
                
                <select id="Select1" name="Select1" runat="server" onchange="selectCity();" >
                     <option  selected="selected">省/直辖市</option>
                </select>
                <select id="Select2" name="Select2" runat="server" onchange="selectCountry()">
                    <option   selected="selected">请选择</option>
                </select>
                <select id="Select3" name="Select3" runat="server" >
                    <option  selected="selected">请选择</option>
                </select>
            </li> 
    string[] proSub = Request.Form.GetValues("Select1");
            string pro1 = proSub[Select1.SelectedIndex];
    
            string[] proSub2 = Request.Form.GetValues("Select2");
            string pro2 = proSub2[Select2.SelectedIndex];
            string[] proSub3 = Request.Form.GetValues("Select3");
            string pro3 = proSub3[Select3.SelectedIndex];
            string pro = Server.HtmlEncode(pro1 + "-" + pro2 + "-" + pro3);
  • 相关阅读:
    Android访问数据库(SQL Server 和 MySQL)
    Andriod开发环境搭建
    SQL 学习记录
    安装双系统 win7 + ubuntu 15.04
    SQL资料
    电脑使用
    python_L7
    ONE
    网页性能优化
    js的继承
  • 原文地址:https://www.cnblogs.com/fumj/p/3242773.html
Copyright © 2011-2022 走看看