hello
your query is very simple friend in ASP.NET you can use the website administration control to set the roles and then use login view control to do this magic for you, the student and teacher will be diverted to the same page but when a student will login he will get a different view and vice versa
go for this link to get the basic assumptions
Login Control
and hers your login view controls description friend
Login View
Do rate my answer once u find it useful
Thanks & Regards
Radix