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"