2012-03-02 91 views

回答

1

我正在使用使用MVC 4的Orchard 1.6。在此版本的MVC中,您可以使用htmlAttributes參數指定類型。

@Html.TextBoxFor(model => model.Url, new{@class = "text-box textMedium", type = "url"}) 
1

只需添加 '類型= URL' 屬性,它將覆蓋 '類型=文本' 屬性:

@Html.TextBoxFor(model => model.Url, new { @type = "url" })