|
-
Jun 26th, 2006, 07:16 AM
#1
Thread Starter
PowerPoster
querystring problem
in my ASP.NET app, I have a problem where if a user clicks on an email to a link to my page, along with it are some querystring values.
the querystring values are incorrect, these values are replaced:
=
&
which makes the querystring invalid.
how can I replace these values that have been changed to the original value? the = and & does not appear in the querystring but are replaced with things like %3d and %26
-
Jun 26th, 2006, 08:18 AM
#2
Re: querystring problem
The links in the email have been generated incorrectly. That is where the problem is arising. What do the email links look like?
-
Jun 26th, 2006, 08:20 AM
#3
Thread Starter
PowerPoster
Re: querystring problem
the email links are in a correct format as I have checked.
Code:
string link = "<a href=\"http://somesite.com/somepage.aspx?something=" + theLink.Trim() + "&another=" + another.Trim() + "\">click here </a>";
some email providers for some reason do this as I have discovered.
I have found that if I use Server.Decode(url) this formats the url back into the correct format but since there will be a few querystrings, how would I then be able to retrieve these querystrings from the Server.Decode(url) ?
-
Jun 26th, 2006, 08:27 AM
#4
Re: querystring problem
I see, that's odd that an email provider would do that. It would break just about every link wouldn't it?
Anyways, you'll get the string once you do the Server.Decode(), so to proceed from here, get the portion of the string after the ?, then split it using the & as a delimiter.
In the array then, you'll have your querystring values.
-
Jun 26th, 2006, 08:32 AM
#5
Thread Starter
PowerPoster
Re: querystring problem
thanks, that is true I could do that but I also thought maybe I could do a Server.UrlDecode(url) and append "&s=1" and redirect it back to the page with this new link.
I would then check to see if it can read the "s" querystring, if so, then continue otherwise do whatever
-
Jun 26th, 2006, 08:39 AM
#6
Re: querystring problem
There are 99 ways to skin a cat.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|