I developed my asp.net site in .NET 2.0 on another system where it works fine. Now that I have copied the asp.net site on my system and started it, I get a runtime error:
The reference to the object is not set to the instance of the object.
public class FixURLs : IHttpModule { public FixURLs() { } #region IHttpModule Members public void Dispose() {
I get an object link error in the line:
context.CompleteRequest();
In my web.Config file there is
<compilation debug="true"> <assemblies> <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </assemblies> </compilation>
How can I fix this problem?
EDIT Change note New code added
void context_BeginRequest(object sender, EventArgs e) { HttpApplication app = (HttpApplication)sender; if (app.Request.RawUrl.ToLower().Contains("/bikes/default.aspx")) { app.Context.RewritePath("BikeInfo.aspx", "", ""); } else if (app.Request.RawUrl.ToLower().Contains("/bikes/mountainbike.aspx")) { app.Context.RewritePath("BikeInfo.aspx", "", "ItemID=1"); } }
Chris source share