Hi
public Location()
{
}
[Key]
[Required]
[RegularExpression(@"^[a-zA-Z'.\s]{1,4}$", ErrorMessage = "Special Characters not allowed")]
[Display(Name = "Id")]
public string Id { get; set; }
[DataType(DataType.Text)]
[RegularExpression(@"^[a-zA-Z'.\s]{1,25}$", ErrorMessage = "Special Characters not allowed")]
[Required(ErrorMessage = "Please enter Location"), MaxLength(25)]
[Display(Name = "Description")]
public string Description { get; set; }
}
********************************************************************************
@model MyApplication.Models.Location
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
@using (Html.BeginForm("CreateEdit", "Location", FormMethod.Post, new { @id = "locationFormId", @class = "form-horizontal", role = "form" }))
{
@Html.AntiForgeryToken()
}
Thanks
Sachin SinghPosted Jun 15, 2021, 8:37 AM
Balaji SaravananPosted Jun 15, 2021, 8:07 AM