CodeVerge.Net Beta
Login Idy
Register Password
  Forgot?
   Explore    Item Entry    Profile    Invite   History    Resources   SiteMap  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML




Zone: > newsgroup > asp.net forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 3/21/2006 12:25:30 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 5 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
kka
Asp.Net User
Masterpage and redirect3/21/2006 12:25:30 PM

0/0

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?

MorningZ
Asp.Net User
Re: Masterpage and redirect3/21/2006 1:27:14 PM

0/0

The Page Load event is much "too late" to set the master page...

if you move that if statement (the part where you try to set the MasterPage, not the redirect) into the Page_PreInit event, it'll work


"If you make it idiot proof, they'll build a better idiot"
2 Items, 1 Pages 1 |< << Go >> >|



Search This Site:





Other Resources:
FindControl and MasterPages - newsgroup.asp-net-forum.general_asp-net ... I have a textbox on a masterpage where users can enter a search query. ... Or use the good old Response.Redirect() and pass the values in the Query String. ...
Redirection on port 443 - ibm.software.websphere.http-servers - Web ... Redirection on port 443, > ROOT > NEWSGROUP > IBM Software > ibm.software. ... help a newb "update a labels text on a masterpage from a content page" please. ...
European World News Review And Comment " Login Login to European World News Review And Comment. Username. Password. Remember Me. Register | Lost your password? " Back to European World News Review And Comment ...
ASP.NET MasterPage Questions : The Official Microsoft Silverlight Site ... Silverlight, post to the forums, read Silverlight blogs and learn about Silverlight. ... I'd like the buttons to redirect me to their corresponding *.aspx pages ...
Brett's SharePoint Blog : Branding a MOSS Corporate Intranet Portal ... Branding Methods by Scope and Scenario The methods matrices referred to in Part 1a ... Custom Master Page Install AND MasterPage-specific HttpModule redirect ...
conditional masterpage based on browser? how to? - ASP.NET Forums ... so that my masterpage.page will recognize a browser that is mobile, and redirect ... just doesn't redirect. Re: conditional masterpage based on browser? how to? ...
MasterPage in VB - ZedGraphWiki Visual Basic Version of the aspx page for the MasterPage Example ... Page MasterPageFile="~/MasterPage.master" Language="vb" Inherits="graph" ...
Facebook Platform Developer Forum / Browser doesn't recognize fb:redirect and this is the MasterPage.master: Code: ... You do realize that fb:redirect is FBML and the only way to test it is to put it ...
Polish News Roundup " Login Polish News Roundup. Username. Password. Remember Me. Lost your password? " Back to Polish News Roundup ...
Response.Redirect stop to work with MasterPage and datapicker ... Redirect stop to work with MasterPage and datapicker. Response.Redirect stop to work with MasterPage and ... Redirect stop to work with MasterPage and ...
 
All Times Are GMT