473,499 Members | 1,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Annoying HttpModule/QueryString Problem

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
Nov 29 '05 #1
0 1023

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
1870
by: Girish | last post by:
Ok, Ive been thinking about this problem for a while. I have 30 odd aspx pages (already built) on my website that I need to have some validation occur before the page should load. The validation...
7
2569
by: nail | last post by:
Folks, I develop a HttpModule and it works correct, but one problem is occurs. After I register the httpmodule in the web.config, my pages (not testing http://localhost/site but...
0
1904
by: Vitali Dzz via .NET 247 | last post by:
Hello I need some help I need to write a code that analyze size of the uploaded file. I wrote such HttpModule: public void BeginRequest(object sender, EventArgs args) { // Create an...
1
5659
by: Li Zhang | last post by:
Hi guys, I am trying to write a httpmodule to implement upload file progress bar. I searched web and got some sample code from code project...
1
1322
by: Hardy Wang | last post by:
Hi all, I built a HttpModule for one of my ASP.NET application to handle some special file format (*.DEC1, *. DEC2). My code is like below public class MyClass : IHttpModule { public MyClass() {...
2
2124
by: Simon-Pierre Jarry | last post by:
Hi, I created a custom HttpModule for managing the security of my application. in "Init" sub, I regsiter the events doing that : Public Sub Init(ByVal context As System.Web.HttpApplication)...
1
1879
by: Faraz | last post by:
Hi everyone, I am running into a slight problem. My understanding is that a custom HttpModule will run for every request made to the server, regardless of the extension. I do not experience this...
0
1731
by: somnathmali | last post by:
Suppose I have site xyz.com. Site has a page called show_user.aspx where I need to access the Session variables. But this show_user.aspx page will not be called directly Instead , when user type...
3
1579
by: Guzeppi | last post by:
if i want to create a redirection service, i.e. requests on a certain url are redirected to other urls depending on the querystring parameters in the request, what is best to use in this case...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7229
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5485
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4921
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3108
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
311
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.