Override existing list of master pages?

  • Thread starter Greg Collins [Microsoft MVP]
  • Start date
G

Greg Collins [Microsoft MVP]

I have a situation where a particular error page is being redirected to (Server.Transfer) and in most cases it works correctly loading the correct master page and rendering as it should.

In another case, this page is being called as a result of an asp:Xml failure, but the Server.Transfer seems to maintain the existing hierarchy of master pages, and thus the page is framed twice when rendered. (Response.Redirect actually works correctly here but causes other issues I don't have time to get into).

So I normally get (as I should):

Master1/ErrorPage

But sometimes I get:

Master1/Master2/Master1/ErrorPAge

So my question is, how can I clear the existing hierrachy of master pages to have just Master1 when the error page is loaded?
 
G

Greg Collins [Microsoft MVP]

I think I might have found a solution for this:

In the OnPreInit() handler I start with: Response.Clear();

If you can think of a reason why this is bad, please let me know. If I find that it doesn't work right, I'll report back.

Thanks.
 

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

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,266
Latest member
DavidaAlla

Latest Threads

Top