Get a template error when I try to do this?

前端 未结 6 1060
夕颜
夕颜 2020-12-17 10:10

I am using asp.net mvc 3 and I keep getting this error and I don\'t understand it since I am not using a template.

I have this in my partial view

@mo         


        
6条回答
  •  春和景丽
    2020-12-17 10:48

    There is an overload that can help achieve this, while keeping it strongly typed.

    // Specify that you're providing the format argument (string)
    @Html.TextBoxFor(x => x.Due, format: Model.Due.ToShortDateString())
    
    // Or use the overload with format and html options, where null is the htmloptions
    @Html.TextBoxFor(x => x.Due, Model.Due.ToShortDateString(), null)
    

提交回复
热议问题