Click here to Skip to main content
11,932,048 members (55,921 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# MVC3

I am using data annotation for model validation. I have tab control which contains item that are required. While I post the page without inserting value in the item that is required, data annotation validation halt the process but item inside the tab doesn't get focused.

This make illusion that form has error but no validation error.

Can any one get out me from this problem.

Prakash Bhatta
Posted 13-May-13 3:04am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Ensure that you validate Model State and return a View with Error Message. I hope you are missing that part because of which you don't see any changes in your UI.
er.prakash.bhatta 13-May-13 8:18am
It returns the message, but it doesn't focus on item which is inside the second tab. So user don't see any changes in UI.
LogeshKumarK 13-May-13 8:35am
Then I think you have to have individual View, Model & Controller for Tabs so that you can directly redirect to respective Views. Else other workaround is to call a JavaScript Method that can Focus on Tab and Element that you actually wanted to enable focus based on message.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151126.1 | Last Updated 13 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100