Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# MVC3
Hi,
 
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.
 
Thanks
Prakash Bhatta
Posted 13-May-13 3:04am

1 solution

Rate this: bad
good
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.
  Permalink  
Comments
er.prakash.bhatta at 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 at 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
0 Sergey Alexandrovich Kryukov 504
1 Maciej Los 349
2 Kornfeld Eliyahu Peter 325
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,303
1 DamithSL 4,764
2 Maciej Los 4,306
3 Kornfeld Eliyahu Peter 3,914
4 Sergey Alexandrovich Kryukov 3,538


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 13 May 2013
Copyright © CodeProject, 1999-2014
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