这样写:前台;
后台:
-
HTML code
-
< 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 >
后台:
-
C# code
-
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);