HighTechTalks DotNet Forums  

Server.Transfer in control's Render event

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Server.Transfer in control's Render event in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
jurev
 
Posts: n/a

Default Server.Transfer in control's Render event - 07-14-2006 , 05:09 AM






In ASP.NET 2.0 I created a custom user control, in overriden Render
event I put Server.Transfer command. I put my control in aspx page. The
behavior is strange: expected behavior would be that the content of
transfered page should be displayed instead of my current aspx page.
But in this case, the content of transfered page is displayed inside
the aspx page where my user control was placed.

Question: what to do in user control Render event when I want the
parent aspx page to be transfered to another page?


Reply With Quote
  #2  
Old   
jurev
 
Posts: n/a

Default Re: Server.Transfer in control's Render event - 07-14-2006 , 07:20 AM






Apparently this does the trick:

Instead of calling Server.Transfer in user control, call this:

Server.Execute(URL, Page.Response.Output);
Page.Response.End();

This will replace the whole aspx page that includes the user control
(instead of replacing only the user control content).

jurev wrote:
Quote:
In ASP.NET 2.0 I created a custom user control, in overriden Render
event I put Server.Transfer command. I put my control in aspx page. The
behavior is strange: expected behavior would be that the content of
transfered page should be displayed instead of my current aspx page.
But in this case, the content of transfered page is displayed inside
the aspx page where my user control was placed.

Question: what to do in user control Render event when I want the
parent aspx page to be transfered to another page?


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.