1. 程式人生 > >AspNetCore taghelpers標簽的使用

AspNetCore taghelpers標簽的使用

d參數 -s summary ida 顯示 netcore demo sharp cor

下面介紹幾種常用的Tag標簽

asp-for  類似於name

asp-validation-for  類似於mvc下的驗證,將的驗證來源於model的驗證特性

asp-validation-summary  是否顯示每個標簽的校驗信息

asp-controller  指定路由中的controller

asp-action  指定路由中的action

asp-route-id  為路由中的id參數賦值

<a asp-controller="Home" asp-action="MyDemo" asp-route-id="1" asp-route-name="zara">sadas</a>

  

AspNetCore taghelpers標簽的使用