473,407 Members | 2,359 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,407 software developers and data experts.

Ampersand in querystring

I Googled this topic and everyone says to use Server.UrlEncode.
No sweat - I did that.
Still doesn't work right though!

Could use some advice.

On the page where I build the link I have code like this for Name="A&S".
Hy1.NavigateUrl = "javascript:CenteredWin('MyPage.aspx?keyvalue= " &
Server.UrlEncode(mData.Name) & "','MyPage',600,500);"

This renders as:
<a id="Hyl1"
href="javascript:CenteredWin('MyPage'.aspx?keyvalu e=A%26S','MyPage',600,500);">A&S</a>

When I click the link the receiving page tries to get the value from the
querystring:

mName = Request.QueryString("keyvalue")

But instead of mName="A&S" it is only mName="A".

I thought the URLEncoding was supposed to fix this.

Why is it still broken?
--
Joe Fallon

Dec 15 '06 #1
1 1316
decode it before you use it.
"Joe Fallon" <jf******@nospamtwcny.rr.comwrote in message news:ui**************@TK2MSFTNGP04.phx.gbl...
>I Googled this topic and everyone says to use Server.UrlEncode.
No sweat - I did that.
Still doesn't work right though!

Could use some advice.

On the page where I build the link I have code like this for Name="A&S".
Hy1.NavigateUrl = "javascript:CenteredWin('MyPage.aspx?keyvalue= " & Server.UrlEncode(mData.Name) & "','MyPage',600,500);"

This renders as:
<a id="Hyl1" href="javascript:CenteredWin('MyPage'.aspx?keyvalu e=A%26S','MyPage',600,500);">A&S</a>

When I click the link the receiving page tries to get the value from the querystring:

mName = Request.QueryString("keyvalue")

But instead of mName="A&S" it is only mName="A".

I thought the URLEncoding was supposed to fix this.

Why is it still broken?
--
Joe Fallon



Dec 16 '06 #2

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

Similar topics

0
by: debk | last post by:
Server.UrlEncode is not longer converting the ampersand in a string to %26 so the value passed in the querystring gets truncated in the following page. Is this a problem with IIS, does anyone know?...
4
by: tfortney | last post by:
I created an iframe HtmlGenericControl that has an ampersand in the "src" attribute..... Dim faxFrame As New HtmlGenericControl("iframe") faxFrame.Attributes.Add("width", "100%")...
1
by: Prasanna Padmanabhan | last post by:
I want to process requests to certain image files that have a custom ..icon(32x32) extenstion with a custom .NET HttpHandler in order to be able to tap into Application events. This works fine...
3
by: Rodusa | last post by:
I am having problems to use Response.Redirect(URL) with this URL below. The problem happens only with 1319& string URL =...
1
by: klynn | last post by:
I have a web.config key as follows: <add key="DOC_TRAILER" value="&Lib=whatever&File=.pdf&Frameset=Created" /> but I cant run the app with this string. Problems with & I tried putting @ at...
4
by: james.eaton | last post by:
I have an XML Schema Document (.xsd) that contains documentation tags (specifically, custom tags subordinate xsd:appinfo). These documentation tags contain strings that may contain ampersands. I...
3
by: Elroyskimms | last post by:
I have to encode an address which contains an ampersand (&) into a URL with various querystring parameters. The following code works fine: URLString = "www.myserver.com?AD1=" &...
13
by: mark4asp | last post by:
When I write a url in xhtml, with an unencoded ampersand, like this: http://localhost:2063/Client/ViewReport.aspx?Ref=58&Type=SUMMARY the xhtml sytax checker correctly indicates an error,...
4
by: Kiran Makam | last post by:
I am setting the content of a div dynamically using innerHTML property. If the content contains an ampersand, text after the ampersand is disappearing in IE6. It works properly in Firefox. This...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.