are different users who visit different pages, depending on their role

Source: Internet
Author: User

http://forums.asp.net/p/2042577/5886687.aspx?p=True&t=635634505624233224

1. In the Login1_loggedin event

protected voidLogin1_loggedin (Objectsender, EventArgs e) {    {             if(Roles.isuserinrole (Login1.username,"Admin")) Response.Redirect ("~/admin/default.aspx"); Else if(Roles.isuserinrole (Login1.username,"User")) Response.Redirect ("~/user/default.aspx"); }}
View Code


2. In the Login1_authenticate event

protected voidLogin1_authenticate (Objectsender, AuthenticateEventArgs e) {        if(Membership.ValidateUser (Login1.username, Login1.password)) {if(Roles.isuserinrole (Login1.username,"Admin") {Response.Redirect ("~/admin/default.aspx"); }            Else if(Roles.isuserinrole (Login1.username,"User") {Response.Redirect ("~/user/default.aspx"); }                       }    }
View Code

are different users who visit different pages, depending on their role

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.