Click here to Skip to main content
15,920,217 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

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

1 solution

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.
Share this answer
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)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900