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.
Up arrow icon