顯示具有 Razor 標籤的文章。 顯示所有文章
顯示具有 Razor 標籤的文章。 顯示所有文章

2011年9月9日 星期五

Html attributes for EditorFor() in ASP.NET MVC 3(use Razor)

最近剛使用ASP.NET的新的view engine:Razor
專案中想讓view的某個欄位是disable的
但是原本用Visual Studio幫你產生出來時,view中的code對於欄位會產生如下:

@Html.EditorFor(model => model.EmployeeNo)


想要讓該欄位disable,後來找了一下資料,試成這樣: