473,405 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Cannot get right value from nested query string

I would like to query a nested query string

go.aspx?redirect=to.aspx?par1=value1&par2=value2

The problem is that inside go.aspx, Request.QueryString("redirect") only
gives me

to.aspx?par1=value1

instead of

to.aspx?par1=value1&par2=value2

Is there any other way to write

go.aspx?redirect=to.aspx?par1=value1&par2=value2

to avoid this problem?.

thanks

Leonardo

Nov 21 '05 #1
6 2816
Hi Leonardo,

You need to url encode the redirect parameter value so it looks something
like:
go.aspx?redirect=to.aspx%3fpar1%3dvalue1%26par2%3d value2

You can url encode strings using shared methods in the HttpUtility class.
For example:

Dim urlEncoded =
HttpUtility.UrlEncode("to.aspx?par1=value1&par2=va lue2")

You can decode the url at the other end in a similar way. For example:

Dim urlDecoded = HttpUtility.UrlDecode(Request.Params("redirect"))

Hope this help,

Phil Harvey

--------------------
http://spaces.msn.com/members/dotnetspace
Nov 21 '05 #2
I would do:

go.aspx?redirect=to.aspx||parms=par1=value1|par2=v alue2

then when you get the parms value you can replace the || with ? and then the
| with & and you have your redirect string.

Just a thought
Chris
"Leonardo Santos-Macias" <ls*********@hotmail.com> wrote in message
news:ul**************@TK2MSFTNGP11.phx.gbl...
I would like to query a nested query string

go.aspx?redirect=to.aspx?par1=value1&par2=value2

The problem is that inside go.aspx, Request.QueryString("redirect") only
gives me

to.aspx?par1=value1

instead of

to.aspx?par1=value1&par2=value2

Is there any other way to write

go.aspx?redirect=to.aspx?par1=value1&par2=value2

to avoid this problem?.

thanks

Leonardo

Nov 21 '05 #3
Thanks Phil...

This has sense but I am not writing any server code, I would like to fix it
in the client page (javascript included) since I want to have a "progress"
gid displayed while I do a search

<script language="javascript">
document.location.href="<%=Request.QueryString("re direct")%>";
</script>
"Phil Harvey" <ph***@teamlink.it> wrote in message
news:em**************@TK2MSFTNGP12.phx.gbl...
Hi Leonardo,

You need to url encode the redirect parameter value so it looks something
like:
go.aspx?redirect=to.aspx%3fpar1%3dvalue1%26par2%3d value2

You can url encode strings using shared methods in the HttpUtility class.
For example:

Dim urlEncoded =
HttpUtility.UrlEncode("to.aspx?par1=value1&par2=va lue2")

You can decode the url at the other end in a similar way. For example:

Dim urlDecoded = HttpUtility.UrlDecode(Request.Params("redirect"))

Hope this help,

Phil Harvey

--------------------
http://spaces.msn.com/members/dotnetspace

Nov 21 '05 #4
Thanks Chris...

This has sense but I am not writing any server code, I would like to fix it
in the client page (javascript included) since I want to have a "progress"
gid displayed while I do a search

<script language="javascript">
document.location.href="<%=Request.QueryString("re direct")%>";
</script>

"Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com> wrote
in message news:Ov**************@TK2MSFTNGP14.phx.gbl...
I would do:

go.aspx?redirect=to.aspx||parms=par1=value1|par2=v alue2

then when you get the parms value you can replace the || with ? and then the | with & and you have your redirect string.

Just a thought
Chris
"Leonardo Santos-Macias" <ls*********@hotmail.com> wrote in message
news:ul**************@TK2MSFTNGP11.phx.gbl...
I would like to query a nested query string

go.aspx?redirect=to.aspx?par1=value1&par2=value2

The problem is that inside go.aspx, Request.QueryString("redirect") only
gives me

to.aspx?par1=value1

instead of

to.aspx?par1=value1&par2=value2

Is there any other way to write

go.aspx?redirect=to.aspx?par1=value1&par2=value2

to avoid this problem?.

thanks

Leonardo


Nov 21 '05 #5
This website will help you!
http://www.kamath.com/codelibrary/cl006_url.asp

var s = Escape(str);
and
var =s Unescape(str);
perform url encoding/decoding in javascript.

Phil Harvey

--------------------
http://spaces.msn.com/members/dotnetspace
Nov 21 '05 #6
Great, thanks!!

"Phil Harvey" <ph***@teamlink.it> wrote in message
news:#5**************@TK2MSFTNGP09.phx.gbl...
This website will help you!
http://www.kamath.com/codelibrary/cl006_url.asp

var s = Escape(str);
and
var =s Unescape(str);
perform url encoding/decoding in javascript.

Phil Harvey

--------------------
http://spaces.msn.com/members/dotnetspace

Nov 21 '05 #7

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

Similar topics

10
by: Jack | last post by:
Hi, I cannot get the date format correctly in dynamic sql statement, after trying various ways of handling it. I need some help with the date format in the following dynamic sql statement. Any...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: Jerry Collings | last post by:
I'm getting improperly nested xml when a column contains null. I modified the first row (customer ALFKI) to have a NULL Address column. I'm using the following XSD Annotated Schema against the...
4
by: Alfetta159 | last post by:
I've been setting up a schema with the XML Designer in VS .NET 2003. The designer lets me set up a lot of things including a complex type that contains an unnamed complex type called modified. ...
4
by: Koen | last post by:
Hi all, At work I created a database which is really helpful. The database is used by approx 15 users. Everything worked great, until I added some 'scoreboard' forms and reports. I get the...
2
by: dskillingstad | last post by:
I would really appreciate someone's help on this, or at least point me in the right direction.... I'm working on a permit database that contains 12 tables, and rather than list all of the...
14
by: c676228 | last post by:
Hi everyone, Our site is down, because of our hosting company applied sql server 2000 sp4 on windows 2000 server. right after it applied the service pack, our sql server database is down and...
1
by: Vishakh | last post by:
Hello, I am trying to create pivot tables using data from CSV files. Here is an example: String conStr = "Driver={Microsoft Text Driver (*.txt; *.csv)};DBQ=C:\\"; String query = "SELECT * FROM...
0
petepell
by: petepell | last post by:
Hello all, I am developing an application in VB 2008 that works with a SQL2005 DB to store and manipulate employee data. In one section of the app I want to be able to show a treeview of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.