T
T
Timur Tuz2015-12-02 14:07:47
ASP.NET
Timur Tuz, 2015-12-02 14:07:47

How to insert validator in Template Editor for Integer?

Why for integer if I do in view:

@Html.EditorFor(Function(model) model.BalanceCalls)
@Html.ValidationMessageFor(Function(model) model.BalanceCalls, "")

The validator fires. And if I put the code in the editor template for integer:
@ModelType Integer
@Html.TextBox("", Model)
@Html.ValidationMessageFor(Function(model) model, "")

The validator is not working. The same construction with strings works fine.
I do the check Required

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timur Tuz, 2015-12-02
@TTA

@model System.Int32 solution

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question