Click here to Skip to main content
15,902,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

 
Share this answer
 
Comments
sanwar_mal_jat 10-Sep-12 7:39am    
This is descriptive solution, Very good , me to 5++
Mohamed Mitwalli 10-Sep-12 7:41am    
Thanks sanwar :)
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"
 
Share this answer
 
Comments
Mohamed Mitwalli 10-Sep-12 7:24am    
5+
sanwar_mal_jat 10-Sep-12 7:37am    
Thanks Mohamed Mitwalli

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