Skip to content Skip to sidebar Skip to footer

Double Input Mvc Extension

Here I was trying to make an extension with double input boxes the returned model's properties are null, They are not correctly bound or there is another issue here, please help me

Solution 1:

You'd probably have an easier time just using an editor template:

Views\Shared\EditorTemplates\DoubleNumber.cshtml

@model DoubleNumber
@Html.TextBoxFor(m => m.Num1)
@Html.TextBoxFor(m => m.Num2)

Then, in your view:

@Html.EditorForModel()

Or, if you've got a property of type DoubleNumber on a view model:

@Html.EditorFor(m => m.MyDoubleNumberProperty)

Post a Comment for "Double Input Mvc Extension"