--- tags: ASP.NET MVC 5.X --- # 0922 - 把 button submit 到 post, ## 參考 SearchList 的 post form ### 定義 會員資料查詢的 Model  ### 解析包裝成 post 的 form:Views\Etkt10\SearchList.cshtml    #### 搜尋按鈕:   ### 搜尋按鈕 所觸發 JavaScript 事件: Scripts\Etkt10\SearchList.js ### /Scripts/Etkt10/SearchList.js? @Model.FullDateTimeNumber" ?? > onclick="_ButtonClient_onClick(this)"   ### id 名稱_JS事件()    ### Action 的 GET 與 POST  #### [HttpPost]  ### 會員資料搜尋結果  ``` @using (Html.BeginPager(Model.PageIndex, Model.PageSize, Model.RowCount)) { <table id="SearchListTable" class="tblzebra"> <tr> <!--會員姓名--> <th nowrap="nowrap" class="text-center"> 會員姓名 </th> <!--性別--> <th nowrap="nowrap" class="text-center"> 性別 </th> <!--生日--> <th nowrap="nowrap" class="text-center"> 生日 </th> <!--身分證字號--> <th nowrap="nowrap" class="text-center"> 身分證字號 </th> <!--手機號碼--> <th nowrap="nowrap" class="text-center"> 手機號碼 </th> <!--國家/城市--> <th nowrap="nowrap" class="text-center"> 國家/城市 </th> <!--地址--> <th nowrap="nowrap" class="text-center"> 地址 </th> </tr> @foreach (var item in Model.lstMember) { <tr> <td nowrap="nowrap" class="text-center"> @item.Name </td> <td nowrap="nowrap" class="text-center"> @item.Gender </td> <td nowrap="nowrap" class="text-center"> @item.Birth </td> <td nowrap="nowrap" class="text-center"> @item.Identify </td> <td nowrap="nowrap" class="text-center"> @item.Phone </td> <td nowrap="nowrap" class="text-center"> @item.Country </td> <td nowrap="nowrap" class="text-center"> @item.Address </td> </tr> } </table> } ``` ## [InputType(EnumInputType.Other)]  ### 生日  ### 身分證字號  ### 性別 #### Model  #### View   ## [BasicCodeType(EnumBasicCodeType.Other)]  ### 國家 ### 城市 ### 作廢 ----- ### 觀念補充: ### 表單中的 GET 與 POST
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up