.Net Core Razor引擎 Form複雜模型繫結
複雜模型的繫結
razor view
<form id='shenlaifusubmit' asp-action="SaveMerchantChannel" method="post">
<div class="form-group">
<label for="pay_memberid">Merchant Id</label>
<input type='text' asp-for="@Model.MerchantPaymentRequest.MerchantId" class="form-control" />
</div>
<div class="form-group">
<label for="pay_memberid">Channel Code</label>
<input id="channel_code" type='text' asp-for="@Model.MerchantPaymentRequest.PayChannelCode" class="form-control" placeholder="請選擇Channel" />
</div>
<div class="form-group">
<label>Pay Memberid</label>
<input type='text' asp-for="@Model.MerchantPaymentRequest.PayMemberId" class="form-control" id='pay_memberid' />
</div>
<div class="form-group">
<label for="exampleInputPassword1">PayBankcode</label>
<input type='text' asp-for="@Model.MerchantPaymentRequest.PayBankcode" class="form-control" id='pay_bankcode' />
</div>
<div class="form-group">
<label for="exampleInputPassword1">PayNotifyurl</label>
<input type='text' asp-for="@Model.MerchantPaymentRequest.PayNotifyurl" class="form-control" id='pay_notifyurl' />
</div>
<button class="btn btn-outline-primary" type="submit">提交</button>
</form>
model
[BindProperties(SupportsGet = true)]
public class PaymentChannelModel
{
public List<PaymentChannel> PaymentChannel { get; set; }
[BindProperty]
public MerchantPaymentRequest MerchantPaymentRequest { get; set; }
}
總結
需要使用特性進行宣告
相關文章
- 【asp.net core】自定義模型繫結及其驗證ASP.NET模型
- 簡單資料繫結和複雜資料繫結
- ASP.NET MVC Razor檢視引擎ASP.NETMVC
- 【ASP.NET Core】MVC模型繫結——實現同一個API方法相容JSON和Form-data輸入ASP.NETMVC模型APIJSONORM
- Dapr + .NET Core實戰(六)繫結
- 理解ASP.NET Core - 模型繫結&驗證(Model Binding and Validation)ASP.NET模型
- 【ASP.NET Core】MVC 控制器的模型繫結(巨集觀篇)ASP.NETMVC模型
- ASP.NET MVC模型繫結——繫結部分欄位ASP.NETMVC模型
- Blazor入門:ASP.NET Core Razor 元件BlazorASP.NET元件
- .Net Core Razor動態選單實現
- 【ASP.NET Core】MVC模型繫結:自定義InputFormatter讀取CSV內容ASP.NETMVC模型ORM
- 【ASP.NET Core】繫結到 CancellationToken 物件ASP.NET物件
- OneThink是不是很難做到複雜模型?模型
- 【ASP.NET Core】MVC模型繫結:非規範正文內容的處理ASP.NETMVC模型
- ASP.NET Core – Razor View Import用途介紹ASP.NETViewImport
- .net core Web API引數繫結規則WebAPI
- vue select 繫結複雜資料和預設顯示Vue
- ASP.Net 管道模型 VS Asp.Net Core 管道 總結ASP.NET模型
- ASP.NET Core 5.0 MVC中的 Razor 頁面 介紹ASP.NETMVC
- 專案複雜度模型(轉)複雜度模型
- ASP.NET MVC 5 Web程式設計4 -- Razor檢視引擎ASP.NETMVCWeb程式設計
- DOM事件模型與Internet explorer事件模型之繫結機制薦事件模型
- Gin 模型繫結驗證模型
- [譯]ASP.NET Core 2.0 路由引擎ASP.NET路由
- DDD中簡單模型比複雜模型更危險模型
- 網路模型複雜度計算方法模型複雜度
- 61. 路由 路由模型繫結路由模型
- [譯]ASP.NET Core 2.0 檢視引擎ASP.NET
- 【資料結構】-時間複雜度和空間複雜度資料結構時間複雜度
- ASP.NET Core MVC 之模型(Model)ASP.NETMVC模型
- 【ASP.NET Core】MVC操作方法如何繫結Stream型別的引數ASP.NETMVC型別
- 優雅的使用路由模型繫結路由模型
- Nancy之ModelBinding(模型繫結)NaN模型
- 微軟開源.NET Core的執行引擎CoreCLR微軟
- Cadence:馴服複雜流程的工作流引擎
- 面試題35:複雜連結串列的複製面試題
- 複雜連結串列的賦值賦值
- 複雜的結構化存取(二)