A
Andreas Zita
What is the problem with this simple code? (implementing IHttpModule to
rewrite an incoming url-request)
private void context_BeginRequest(object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication;
try { System.Collections.Specialized.NameValueCollection test =
app.Request.QueryString; }
catch { }
app.Context.RewritePath("~/Library.aspx?token=Album&id=3");
}
The request returns 404 in Explorer.
When commenting out the try-statement it works, as well as when removing the
querystring part from the rewritepath value. But why???
What I want is to get the correct value for "id" and combine that with the
new rewritepath.
The inputpath is in the form: "~/Album.aspx" or "~/Album.aspx?id=3".
Please help me! This is insane!!!
/Andreas Zita
rewrite an incoming url-request)
private void context_BeginRequest(object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication;
try { System.Collections.Specialized.NameValueCollection test =
app.Request.QueryString; }
catch { }
app.Context.RewritePath("~/Library.aspx?token=Album&id=3");
}
The request returns 404 in Explorer.
When commenting out the try-statement it works, as well as when removing the
querystring part from the rewritepath value. But why???
What I want is to get the correct value for "id" and combine that with the
new rewritepath.
The inputpath is in the form: "~/Album.aspx" or "~/Album.aspx?id=3".
Please help me! This is insane!!!
/Andreas Zita