I've got 3 folders - one for the loginpages, one for default users and one for administrators. The problem is that when a default user logs in everything works as expected. But when an administrator logs in the user should be redirected to a special page and masterpage which has some extra features on. I've managed to redirect the administrator to the right page. But the page uses the masterpage of the default user.
The code looks like this:
protected void Page_Load(object sender, EventArgs e)
{
if (User.Identity.Name.Equals("admin"))
{
//base.MasterPageFile = "~/Admin/DefaultMasterPage2.master";
//Page.MasterPageFile = ("~/Admin/DefaultMasterPage2.masterDefaultMasterPage2.master");
Response.Redirect("~/Admin/success.aspx");
}
}
You see that I've tried to solve the problem in the linies above the redirect.
My structure of folders is:
-Admin
-Login
-Normal
The part of login takes place in the "Login"-folder. It perfectly redirects to the "Normal"-folder, but NOT administrators to the "Admin"-folder. Well, actually it does but without the masterpage in the "Login"-folder. How can I correct this?