2
TextAreaFor代碼以下是我的模型屬性置換在Asp.net MVC剃刀
[Required(ErrorMessage = "Please Enter Short Desciption")]
[StringLength(200)]
public string ShortDescription { get; set; }
而下面是我相應的視圖代碼
@Html.TextAreaFor(model => model.Product.ShortDescription, new { cols = "50%", rows = "3" })
@Html.ValidationMessageFor(model => model.Product.ShortDescription)
,這是它是如何顯示在瀏覽器中,我想要的方式。
現在,因爲有一個bug in Microsoft's MVC3 release,我無法驗證和表單提交併產生惱人的錯誤。
請告訴我可以替代TextAreaFor的工作或任何代碼。我無法使用EditorFor,因爲有了它,我無法使用行和列參數。我想在瀏覽器中保持我的字段外觀。讓我知道應該在這種情況下
對不起隊友,我是不能夠做任何事情的SO最近幾個小時,因爲在這裏的外部域JavaScript。將這個代碼放在工作中,讓你知道....謝謝 – 2012-01-04 10:44:49