Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET validation
Dear Friends,
 
am working on Asp.net C3, SqlServer 2005.
 
on my web page i have two logins....
one login is for student and the other login is for Teacher.
 
In student Login I have
student Name(TxtStudentName)
Password(TxtStuPassword , and a
submit button(BtnStudentSubmit)
 

and in Teachers Login I have
Teachers Name(TxtTeacherName)
Password(TxtTeachPassword)
Submit Button(BtnTeacherSubmit)
 

 
so, I have took Checkboxes for both the logins.
 
Generally when Page loads both are enabled = false;
 
IF am a student, when I ticks the checkbox Student login will be ENABLED. and Teachers login will be Disabled.
 
OK, I did Till here its running fine.
 
BUT MY PROBLEM is I need Validations when Submit button click. When user not enters and click on student submit button. it must show error.
 

My REquirement is HOW TO GIVE VALIDATIONS FOR 2 SUBMIT BUTTONS IN one Page.
 
Please help me, Thanks for ever.
Posted 10-Sep-12 1:32am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi dude use ValidationGroup property 
as like in aspx page 
 
TxtStudentName -> ValidationGroup ="stu"
TxtStuPassword -> ValidationGroup ="stu"
BtnStudentSubmit -> ValidationGroup ="stu"
 
TxtTeacherName-> ValidationGroup ="teac"
TxtTeachPassword-> ValidationGroup ="teac"
BtnTeacherSubmit-> ValidationGroup ="teac"
  Permalink  
Comments
Mohamed Mitwalli at 10-Sep-12 7:24am
   
5+
sanwar mal jat at 10-Sep-12 7:37am
   
Thanks Mohamed Mitwalli
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
sanwar mal jat at 10-Sep-12 7:39am
   
This is descriptive solution, Very good , me to 5++
Mohamed Mitwalli at 10-Sep-12 7:41am
   
Thanks sanwar :)

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 8,478
1 OriginalGriff 6,516
2 Peter Leow 3,567
3 Zoltán Zörgő 3,386
4 Richard MacCutchan 2,397


Advertise | Privacy | Mobile
Web01 | 2.8.150123.1 | Last Updated 10 Sep 2012
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