redirect user after login to some pages

S

SemSem

Helloz

iam working in a web application for univesity.

ihave diffrent kind of roles like:

1-Studetn Affairs 2-Staff

imake three sperate master pages for them.:
example:
1-SA.mastepage 2-Staff.masterpage 3-main.masterpage
and each one contain alot of child pages(home,add stydet,.....)

and i sperate Staff pages and student affiars pages in two folder


and when user go to the site he see the home pages is child for the main
master page wich contian some information adn a menu in the left has some
links
liks(about,login,inf about...,....,)

iwant when the user but clik the login links and go to the login pages and
enterd the password .

if his role is studenAffairs he redirect to the homewhich is child of
Sa.masterpage.
and if he is staff he goes to home for staff.masterpage.

itry this but it dosn't work

in event logged in of the login contorl:

protected void Login1_LoggedIn(object sender, EventArgs e)
{

if (User.Identity.IsAuthenticated)
{


if (User.IsInRole("Student Affairs"))
{

Response.Redirect(

"~/StudentAffairsFolder/home.aspx");
}

}

else if (User.IsInRole("Staff"))
Response.Redirect("~/staff/Default.aspx");

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,815
Latest member
treekmostly22

Latest Threads

Top