Click here to Skip to main content
13,146,663 members (68,244 online)
Rate this:
 
Please Sign up or sign in to vote.
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 10-Sep-12 0: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 10-Sep-12 7:24am
   
5+
sanwar mal jat 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 10-Sep-12 7:39am
   
This is descriptive solution, Very good , me to 5++
Mohamed Mitwalli 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
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web02 | 2.8.170915.1 | Last Updated 10 Sep 2012
Copyright © CodeProject, 1999-2017
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