我正在Asp.Net MVC中从事英语和阿拉伯文化的工作。我需要用两种语言填写表格的地方。因此,当我选择英语文化并用日期填写表格时,我会在控制器端得到正确的日期,并且数据已成功保存在数据库中。当我选择阿拉伯文化并从日期选择器中选择日期时,在控制器端,我得到了错误的日期,例如01/01/0001
。我不知道日期从哪里改变。
如何使它正常工作?
模型侧:
public DateTime BirthDate { get; set; }
查看侧:
@Html.TextBoxFor(m => m.BirthDate,new { @type = "text",@class = "form-control form-control-sm birth_date" } )
控制器端:
[HttpPost]
public actionResult ProfileForm(Users userData)
{
//So on submit of form in arabic culture I am gettting Date like 01/01/0001 from view side automatically.
}