Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   ASP.NET (http://www.programmingforums.org/forum35.html)
-   -   ASP.NET Custom Validation (http://www.programmingforums.org/showthread.php?t=15169)

Robocop Feb 12th, 2008 9:18 PM

ASP.NET Custom Validation
 
I have two textboxes, which I want to validate, but the thing is that one of them must be filled, but not both. How can I add this validation to the validation summary? I looked at the methods but none seem to do this. I have added RequiredFieldValidator for other textboxes and their messages are showing up, but I need advise with this.

Thanks

mbd Feb 13th, 2008 12:47 AM

Re: ASP.NET Custom Validation
 
http://msdn2.microsoft.com/en-us/lib...or(VS.71).aspx

itgalary Feb 13th, 2008 9:54 AM

Re: ASP.NET Custom Validation
 
I think an easy logic is to concatenate the text of both and then check if its not empty

eg. Text1 is aaa and text2 nothing then catenetated will be aaa and vice versa

dilipv Mar 7th, 2008 12:31 AM

Re: ASP.NET Custom Validation
 
Quote:

Originally Posted by Robocop (Post 141010)
I have two textboxes, which I want to validate, but the thing is that one of them must be filled, but not both. How can I add this validation to the validation summary? I looked at the methods but none seem to do this. I have added RequiredFieldValidator for other textboxes and their messages are showing up, but I need advise with this.

Thanks


Hi Robocop,

i saw your quote and even i too suggest that by using if - else condition you can make it out.i would to know on which technology you r working with.

Thank you
Jitesh
Programmer
Sharepoint Consulting


All times are GMT -5. The time now is 3:35 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC