O'Reilly Forums: Httpmodule With Server.transfer - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Httpmodule With Server.transfer

#1 User is offline   endapally 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 20-July 10

Posted 20 July 2010 - 01:32 PM

Hi
I have a HTTPMODULE which is used to transfer from Ugly URL to other URL. But the Ugly URL should be shown. So I am using Server.Transfer.

But when I do a Server.Transfer like context.Server.transfer("../DtssHomePage/DtssHomePage.aspx?PageID=29&activity=football", true);


I'm getting Error executing child request for ../DtssHomePage/DtssHomePage.aspx and inner exception message has Exception of type

'System.Web.HttpUnhandledException' was thrown. Can we use query string for server.transfer like above? Find below for my HTTP Module.


public class HTTPModule : IHttpModule
{
public void Init(HttpApplication application)
{
application.BeginRequest += new EventHandler(this.Application_BeginRequest);
}

private void Application_BeginRequest(Object source,
EventArgs e)
{

HttpApplication app;
string requestUrl;
app = source as HttpApplication;
requestUrl = HttpContext.Current.Request.Url.AbsoluteUri;

HttpContext context = app.Context;

context.Server.transfer("../DtssHomePage/DtssHomePage.aspx?PageID=29&activity=football", true);

}

}

public void Dispose() { }
}
}

Thanks

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users