0x49D1
0x49D1

Reputation: 8704

Add unobtrusive validation to ModelBinded asp.net 4.5 WebForms page

I have a FormView that is binded to model. And use such controls inside it:

<asp:TextBox runat="server" ID="txtName" Text='<%#: BindItem.Name %>'></asp:TextBox>

After i've added annotations to the object the form is binded to- validation started to work, but i can't see any validation messages. How to properly do that?
PS:

 ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.WebForms; 

Upvotes: 1

Views: 1061

Answers (1)

Anand
Anand

Reputation: 1450

Have you tried the <asp:ValidationSummary> control?

Like this:

<asp:ValidationSummary ID="ValidationSummary1" runat="server" 
     DisplayMode="BulletList" ShowModelStateErrors="true" />

Upvotes: 1

Related Questions