Server.TransferRequest()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt Winward

    Server.TransferRequest()

    Hi all.

    On requests for a parent web application, and when certain conditions
    match, I need to load pages from a child web application. I've been
    playing around with various methods, including RewritePath and
    Server.Transfer , but these each have problems of their own.

    Reading up on TransferRequest , this seems like the ideal solution
    where the request is sent back through the IIS pipeline and the user
    will see the results from the sub application, but the URL will remain
    unchanged .. perfect.

    The problem is that when I try this, the URL *does* get changed. I may
    as well have just done a Response.Redire ct! Obviously I'm doing
    something wrong. Anyone know what it might be??


    Thanks,

    Matt
  • Matt Winward

    #2
    Re: Server.Transfer Request()

    I've just put together a very simple test solution with the following
    files:

    Default.aspx
    Test.aspx
    MyModule.cs

    I've added MyModule to the Web.Config and made it TransferRequest to
    Test.aspx.

    This works perfectly and loads the content of Test.aspx under the
    guise of Default.aspx. I'm not sure why this works and my main
    solution doesn't, but I'll keep looking into it; I'm sure it will turn
    out to be something stupidly simple!

    Comment

    • George Ter-Saakov

      #3
      Re: Server.Transfer Request()

      I would recommend using HttpContext.Rew ritePath
      I am successfully using it.
      so if you have unresolved problems let us know and we'll help you to solve
      them



      George.

      "Matt Winward" <m.winward@gmai l.comwrote in message
      news:c019403f-4cfa-472a-bf79-bed99e24e21f@q7 8g2000hsh.googl egroups.com...
      Hi all.
      >
      On requests for a parent web application, and when certain conditions
      match, I need to load pages from a child web application. I've been
      playing around with various methods, including RewritePath and
      Server.Transfer , but these each have problems of their own.
      >
      Reading up on TransferRequest , this seems like the ideal solution
      where the request is sent back through the IIS pipeline and the user
      will see the results from the sub application, but the URL will remain
      unchanged .. perfect.
      >
      The problem is that when I try this, the URL *does* get changed. I may
      as well have just done a Response.Redire ct! Obviously I'm doing
      something wrong. Anyone know what it might be??
      >
      >
      Thanks,
      >
      Matt

      Comment

      Working...