Login And redirect for specefic users

Discussion in 'ASP General' started by SemSem, Feb 4, 2007.

  1. SemSem

    SemSem Guest

    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");

    }

    --
    Islam Khalil,
    SemSem, Feb 4, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sara rafiee
    Replies:
    3
    Views:
    1,054
    Scott Allen
    Oct 4, 2004
  2. Sunil Miriyala
    Replies:
    0
    Views:
    757
    Sunil Miriyala
    Mar 1, 2004
  3. bitshift
    Replies:
    1
    Views:
    544
    bruce barker
    Jun 22, 2007
  4. Sal
    Replies:
    1
    Views:
    406
  5. SemSem
    Replies:
    1
    Views:
    107
    Mike Brind
    Feb 5, 2007
Loading...

Share This Page