We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Creating a Numeric TextBox

Hi,

I am creating a numeric textbox model and i cannot assign the model i created in the controller to the Html.NumericTextBox Helper class. It just created a numeric textbox but does not implement the assigned model properties.

I am currently using 8.104.0.30 version.

Thanks

1 Reply

PK Prem Kumar D Syncfusion Team July 1, 2010 04:07 PM UTC

Hi Dennis,

Thanks for using Syncfusion products

With regard to your query, you can follow the code below to set the properties

[Controller]
public ActionResult Index()
{
NumericTextBoxModel myModel = new NumericTextBoxModel();
myModel.MinValue = 10;
myModel.MaxValue = 20;

ViewData["myNumeric"] = myModel;
return View();
}

[ASPX]
<%=Html.NumericTextBox("myNumeric")%>

Note:The id of the Numeric textbox should match with the ViewData key

Please get back to us for any further queries

Regards,
Premkumar D

Loader.
Live Chat Icon For mobile
Up arrow icon