ASP.NET MVC入門:淘寶商品的搜尋和價格篩選

來源:互聯網
上載者:User

五一前後一直在忙安卓的東西,直到現在終於有機會喘口氣了,於是就抽空寫了這篇博文,來記錄我之前 學習MVC一周后所寫的小例子:搜尋淘寶商品並對商品進行價格篩選。

先上開始介面:

這 個介面的源碼如下:

@{    ViewBag.Title = "首頁";}     <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>    @using (Html.BeginForm()) {    <fieldset>            <legend>Search</legend>        <p id ="editor-field">            <p>搜尋商品 @Html.TextBox("keyword")</p>             <p>價格上限 @Html.TextBox("max")</p>            <p>價格下限 @Html.TextBox("min")</p>        </p>    </fieldset>        <p>            <input type="submit" value="Search" />        </p>}

值得注意的是我標為紅色的代碼,TextBox提供使用者輸入,並且提交使用者輸入,括弧裡的 "keyword"是用來標識所提交的內容,方便我們從提交的表單中提取出使用者的輸入。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.