Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querystring

Status
Not open for further replies.

cyberdeminout

Programmer
Jul 19, 2005
37
US
Hi,

In my project, we added tracking feature whether user clicked on link or not. On click of Link, we are passing
tracking id and url to redirect(it includes querystring).
See following URL.

Ex:
<a href=
when i call request("redirectuser").
I am getting
how to get whole redirectuser url like this? (
Appreciate your great help.
Thanks
 
hi, how are you setting this URL (using a link control?)

Known is handfull, Unknown is worldfull
 
then why is & printed as &amp;???

Known is handfull, Unknown is worldfull
 
i'd given & only. But tek-tips.com converting it to &amp; symbol.

Thanks
 
You'll have to encode the ampersands and then decode them later (have a look at Server.HTMLEncode and Server.HTMLDecode)


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
that sholdn't work. the solution is

Replace & in redirectuser (second url) with a different character, place it in the querystring and then change it back in code.

 
That's an interesting approach. Why ask for help and then say the solutions offered won't work without even trying them?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Replace & in redirectuser (second url) with a different character, place it in the querystring and then change it back in code.

That is completely off base. The HTMLEncode method was made for this task. Unless you want to go outside the bounds of how you should be doing things and do them in basically a hack form then go at it. I just hope I don't have to maintain it later on. ;-)


____________ signature below ______________
General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
just now i got the solution. previously am not aware of this. supposed to post the answer here and received an email from you before my post?

Thanks
 
Excellent. I wonder how would you set this if we are sending email( includes above links) in VB.NET application.

Rams
 
I don't really understand the question...

Do you mean that you just want to send a link in an email?

You would do it the same way, just urlencode the part that I put above, then add it to the body of your email.

Don't urlencode the whole string, just the specific query parameters .
 
thanks. My email body have those links and previous written in using asp.net. Now can i use the same method (urlencode and decode)using vb.net desktop application.

appreciate your great help.

Thanks
Ram
 
I assume if you add a reference to the system.web (or maybe system.net?) namespace then yes, but I don't really do windows forms programming, so I'm not sure.

On second thought, I'm pretty sure that you can, because I do it from some separate classes that I use, just lookup the "server.urlencode class" in google, so you can know which reference to add.

If you can't find it, then let me know and I'll look back through some code and post back.
 
I have tried using both methods(Imports System.web and system.net) and also tried to get that by using Add Reference and selected Web.dll in VB. But no luck.

Thanks for your help
 
My class is actually a base page that inherits from system.web.ui.page, then I use System.Web.HttpUtility.UrlEncode(string)

I'm using the 2.0 framework.
 
when i add reference of web.dll and writing Imports System.web.ui.page and declaring server.urlencode and it highlights the code with this error. "Reference to a non-shared memeber requires an object reference"

 
I've run into that before too. Try this...

Code:
HttpContext.Current.Server.UrlEncode(string)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top