【发布时间】:2013-12-02 13:22:22
【问题描述】:
我有一个超级快速的问题要问你,我想你可以快速回答。 我正在构建的网站上有一个搜索页面,它使用查询字符串参数来更改搜索结果。
我还希望任何查询字符串参数都能反映嵌入在同一页面上的搜索表单。它非常适合输入框。例如:
修改后的代码:
var proptype = db.Query("SELECT * FROM Property_Type");
string propertyType = "";
propertyType = Request.QueryString["propertyType"];
<select name="propertytype">
<option value="">Any</option>
@foreach(var type in proptype){
<option value="@type.PropertyTypeID" selected="@(propertyType == type.PropertyTypeID)">@type.PropertyType</option>
}
</select>
谢谢,加文
【问题讨论】: