后台获取前台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);

 

posted @ 2013-08-07 11:33  ``炯``  阅读(2364)  评论(0编辑  收藏  举报