Hi Ishan,
Greetings from Syncfusion support.
We have prepared sample based on your requirement using Required and MaxLength validation. Please find the sample below.
|
@using (Html.BeginForm())
{
@Html.ValidationSummary(true)
<div class="col-lg-12 control-section">
<div id="wrapper">
@Html.EJS().NumericTextBoxFor(model => model.value).Width("200px").Render()
<div>
@Html.ValidationMessageFor(model => model.value)
</div>
<div id="submitbutton">
@Html.EJS().Button("btn").Content("Post").Render()
</div>
</div>
</div>
} |
[Controller]
|
public class NumericValue
{
[Required]
[Range(1, 10)]
public int value { get; set; }
}
public class HomeController : Controller
{
public ActionResult Index()
{
NumericValue val = new NumericValue();
val.value = 10;
return View(val);
}
[HttpPost]
public ActionResult Index(NumericValue model)
{
NumericValue val = new NumericValue();
val.value = model.value;
return View(val);
} |
Please get back us if you need further assistance.
Regards,
Ponmani M