Server.Transfer in control's Render event

Discussion in 'ASP .Net Building Controls' started by jurev, Jul 14, 2006.

  1. jurev

    jurev Guest

    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?
     
    jurev, Jul 14, 2006
    #1
    1. Advertising

  2. jurev

    jurev Guest

    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:
    > 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?
     
    jurev, Jul 14, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    736
  2. Lau Lei Cheong

    Page.Render do not render complete page

    Lau Lei Cheong, May 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,100
    Lau Lei Cheong
    May 15, 2004
  3. sonic
    Replies:
    1
    Views:
    545
    John Saunders
    Jan 7, 2005
  4. Jim
    Replies:
    1
    Views:
    963
    Aaron Bertrand - MVP
    Jan 28, 2004
  5. Glenn Gillen
    Replies:
    0
    Views:
    307
    Glenn Gillen
    Nov 17, 2006
Loading...

Share This Page