C#网页上获取下拉列表的值
下面是代码<formaction="/search.aspx"id="sform"method="post"><divclass="sxq_tj"><ul><li>户型:...
下面是代码
<form action="/search.aspx" id="sform" method="post">
<div class="sxq_tj">
<ul>
<li>户型:<span>
<select name="type1" class="xial" style="width:110px; overflow:hidden;">
<option value="0">所有户型</option>
<option value="3室1厅">3室1厅</option>
<option value="3室2厅2卫">3室2厅2卫</option>
</select></span></li>
<li>风格:<span>
<select name="type2" class="xial" style="width:110px; overflow:hidden;">
<option value="0">所有风格</option>
<option value="欧式风格">欧式风格</option>
<option value="现代风格">现代风格</option>
</select></span></li>
<li>面积:<span>
<select name="type3" class="xial" style="width:110px; overflow:hidden;">
<option value="0">所有面积</option>
<option value="80平方米以下">80平方米以下</option>
<option value="80~100平方米">80~100平方米</option>
</select>
</span></li>
<li>造价:<span>
<select name="type4" class="xial" style="width:110px; overflow:hidden;">
<option value="0">所有造价</option>
<option value="3万以下">3万以下</option>
<option value="3~5万">3~5万</option>
</select>
</span></li>
</ul>
</div>
<div class="search_right">
<input type="image" name="imageField" src="../images/sbtn.jpg" />
</div>
</form>
接收页面search.aspx的后台
我用Request["type1"]接收的值是空的,怎么回事?
string house = Request["type1"];
string manner = Request["type2"];
string proportion = Request["type3"];
string building = Request["type4"];
Session["type1"] = house;这个也是空 展开
<form action="/search.aspx" id="sform" method="post">
<div class="sxq_tj">
<ul>
<li>户型:<span>
<select name="type1" class="xial" style="width:110px; overflow:hidden;">
<option value="0">所有户型</option>
<option value="3室1厅">3室1厅</option>
<option value="3室2厅2卫">3室2厅2卫</option>
</select></span></li>
<li>风格:<span>
<select name="type2" class="xial" style="width:110px; overflow:hidden;">
<option value="0">所有风格</option>
<option value="欧式风格">欧式风格</option>
<option value="现代风格">现代风格</option>
</select></span></li>
<li>面积:<span>
<select name="type3" class="xial" style="width:110px; overflow:hidden;">
<option value="0">所有面积</option>
<option value="80平方米以下">80平方米以下</option>
<option value="80~100平方米">80~100平方米</option>
</select>
</span></li>
<li>造价:<span>
<select name="type4" class="xial" style="width:110px; overflow:hidden;">
<option value="0">所有造价</option>
<option value="3万以下">3万以下</option>
<option value="3~5万">3~5万</option>
</select>
</span></li>
</ul>
</div>
<div class="search_right">
<input type="image" name="imageField" src="../images/sbtn.jpg" />
</div>
</form>
接收页面search.aspx的后台
我用Request["type1"]接收的值是空的,怎么回事?
string house = Request["type1"];
string manner = Request["type2"];
string proportion = Request["type3"];
string building = Request["type4"];
Session["type1"] = house;这个也是空 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询