mvc.net分页查询案例——前台页面(Index.aspx)

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Shite.Master" Inherits="System.Web.Mvc.ViewPage<System.Web.Mvc.PagedList<HouseSys.Models.HouseModel> >" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    首页
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">


<DIV id=navbar class=wrap>
<DL class="search clearfix">
  <FORM id=sform method=post action=search.action>
  <DT>
  <UL>
    <LI class=bold>房屋信息</LI>
    <LI>标题:<INPUT class=text type=text name=title> <LABEL class=ui-blue><INPUT οnclick=doSearch() value=搜索房屋 type=button name=search></LABEL> 
    </LI></UL></DT>
  <DD>
  <UL>
    <LI class=first>价格 </LI>
    <LI><SELECT name=price> <OPTION selected value="">不限</OPTION> <OPTION 
      value=0-100>100元以下</OPTION> <OPTION value=100-200>100元—200元</OPTION> 
      <OPTION value=200-1000000>200元以上</OPTION></SELECT> </LI></UL></DD>
  <DD>
  <UL>
    <LI class=first>房屋位置</LI>
    <LI>
        <%--《SELECT id=street name=street_id> <OPTION selected 
      value="">不限</OPTION> <OPTION value=1000>知春路</OPTION> <OPTION 
      value=1001>中关村大街</OPTION> <OPTION value=1002>学院路</OPTION> <OPTION 
      value=1003>朝阳路</OPTION>

        </SELECT> --%>
        <%=Html.DropDownList("street",(SelectList)ViewData["selectStree"],"不限")%>

    </LI></UL></DD>
  <DD>
  <UL>
    <LI class=first>房型</LI>
    <LI>
       <%-- <SELECT name=type_id> <OPTION selected value="">不限</OPTION> <OPTION 
      value=1000>一室一厅</OPTION> <OPTION value=1001>一室两厅</OPTION> <OPTION 
      value=1002>两室一厅</OPTION> <OPTION value=1003>两室两厅</OPTION></SELECT> --%>
         <%=Html.DropDownList("type",(SelectList)ViewData["selectType"],"不限")%>
  </LI></UL></DD>
  <DD>
  <UL>
    <LI class=first>面积 </LI>
    <LI><SELECT name=floorage> <OPTION selected value="">不限</OPTION> <OPTION 
      value=0-40>40以下</OPTION> <OPTION value=40-500>40-500</OPTION> <OPTION 
      value=500-1000000>500以上</OPTION></SELECT> </LI></UL></DD>
       <LABEL class="ui-green searchs"><a href="fabu.htm" title="">查询</a></LABEL>
  </FORM></DL>
       

</DIV>
<DIV class="main wrap">
<TABLE class=house-list>
  <TBODY>

<%
    foreach(var house in Model)
    {
        %>
      
       <TR>
            <TD class=house-thumb><span><A href="details.htm" target="_blank"><img src="../images/thumb_house.gif" width="100" height="75" alt=""></a></span></TD>
            <TD>
              <DL>
                <DT><A href="details.htm" target="_blank"><%=house.Title %></A></DT>
                <DD><%=house.Street.Name %><BR>联系方式:<%=house.Contract %></DD></DL></TD>
            <TD class=house-type><%=house.Type.Name %></TD>
            <TD class=house-price><SPAN><%=house.Price %></SPAN>元/月</TD>

       </TR>
      
      <%
        
    }
    
     %>
 



  </TBODY>

</TABLE>
<DIV class=pager>
    <%=Html.Pager<HouseSys.Models.HouseModel>(Model) %>

</DIV>

</asp:Content>

posted @ 2017-07-07 07:39  穆雄雄  阅读(99)  评论(0编辑  收藏  举报