473,698 Members | 2,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ampersand problem

I am having problems to use Response.Redire ct(URL) with this URL below.
The problem happens only with 1319&

string URL =
"default.aspx?c ontactid=C6UJ9A 000R9D&uidcusto mquote=1319&quo teuserid=ADMIN& slxuserid=ADMIN ";
I try to response.write( URL) and I get this as a result
default.aspx?co ntactid=C6UJ9A0 00R9D&uidcustom quote=1319"euse rid=ADMIN&slxus erid=ADMIN
I obtained the querystring of this URL with
Request.ServerV ariables("QUERY _STRING") and I tried to encode it with
Server.URLEncod e, however I still get the same URL above. It is really
weird because the other parameters seem to be ok.

Please help

Rod

Nov 19 '05 #1
3 2244
The problem is that "&quot" is being interpreted as " .

Try
string URL =
"default.aspx?c ontactid=C6UJ9A 000R9D&uidcusto mquote=1319&use rid=ADMIN&slxus erid=ADMIN";

You may have to change your parameter's name from
quoteuserid to userid, or any other name *but* quoteuserid.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
=============== ======

"Rodusa" <rc**********@y ahoo.com> wrote in message
news:11******** **************@ l41g2000cwc.goo glegroups.com.. .
I am having problems to use Response.Redire ct(URL) with this URL below.
The problem happens only with 1319&

string URL =
"default.aspx?c ontactid=C6UJ9A 000R9D&uidcusto mquote=1319&quo teuserid=ADMIN& slxuserid=ADMIN ";
I try to response.write( URL) and I get this as a result
default.aspx?co ntactid=C6UJ9A0 00R9D&uidcustom quote=1319"euse rid=ADMIN&slxus erid=ADMIN
I obtained the querystring of this URL with
Request.ServerV ariables("QUERY _STRING") and I tried to encode it with
Server.URLEncod e, however I still get the same URL above. It is really
weird because the other parameters seem to be ok.

Please help

Rod

Nov 19 '05 #2
You'll probably want to encode your URLs so you don't run into formatting
issues such as this.
Use Server.URLEncod e.
Here's more info:
http://www.intellidimension.com/defa..._urlencode.rsp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Rodusa" <rc**********@y ahoo.com> wrote in message
news:11******** **************@ l41g2000cwc.goo glegroups.com.. .
I am having problems to use Response.Redire ct(URL) with this URL below.
The problem happens only with 1319&

string URL =
"default.aspx?c ontactid=C6UJ9A 000R9D&uidcusto mquote=1319&quo teuserid=ADMIN& slxuserid=ADMIN ";
I try to response.write( URL) and I get this as a result
default.aspx?co ntactid=C6UJ9A0 00R9D&uidcustom quote=1319"euse rid=ADMIN&slxus erid=ADMIN
I obtained the querystring of this URL with
Request.ServerV ariables("QUERY _STRING") and I tried to encode it with
Server.URLEncod e, however I still get the same URL above. It is really
weird because the other parameters seem to be ok.

Please help

Rod

Nov 19 '05 #3
Steve,

I did try encoding with Server.URLEncod e. However, I can only encode
the parameters individually because when I encode the whole QueryString
via Request.ServerV ariables["QUERY_STRI NG"] it messes up the (=)
making the URL invalid. The easier way is what Juan suggested: to
change the param name uidcustomquote to something else.

I appreciate your suggestions
Rod

Nov 19 '05 #4

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

Similar topics

5
34696
by: Magnus Warker | last post by:
Hi, when I try to pass some parameters in an URL, I always get an URL where the ampersand is represented as '&amp;'. I tried: $url = "wsp.php?mod=$mod&sec=$sym"; $url = "wsp.php?mod=$mod" . '&' . "sec=$sym";
0
4114
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? I can't find this reported anywhere else. I may just have to code around it. Details: link is created by the following code: <a>href="GroupDetails.asp?groupName=<%=Server.URLEncode(objRecordset("Group_Name"))%>">Group Details</a> If...
4
3726
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%") faxFrame.Attributes.Add("height", "90%") faxFrame.Attributes.Add("frameborder", "no") faxFrame.Attributes.Add("src", "/archive/view.aspx?isPlugin=" & isPlugin & "&iDoc=" & Server.UrlEncode(intDoc))
1
2882
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 almost everytime except that I get a 404 error when trying to access a file with an ampersand in its name. The error happens only if I point the aspnet_isapi.dll to the .NET Framework 1.1. If I use the aspnet_isapi.dll of the old .NET framework...
1
5915
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 beginning but that didnt fix it. What am I missing?
4
3074
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 have written an XSL Document (.xls) to extract these values and output an XML document including them on the screen. When I copy and paste the result to an XML file (.xml) and test for well-formedness, I get an error telling me that a semicolon...
3
6658
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=" & HTTPUtility.URLEncode("500 Rt 6 & 209") and then to retrieve it: txtAddress1.text = Request.Querystring("AD1") However, in a different page of code, I loop through the QueryString.AllKeys collection like this:
3
5592
by: jodleren | last post by:
Hi Pretty simple, I am sure. I have a small JS script, which is function OpenSomething(input) { win3=window.open("some_file.php?info=" + input,"mywin","width=500,height=600,scrollbars=yes,resizable=yes"); return false; }
13
5356
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, telling me that it should be: http://localhost:2063/Client/ViewReport.aspx?Ref=58&amp;Type=SUMMARY see: <http://www.htmlhelp.com/tools/validator/problems.html#amp>
4
4217
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 is my code: ---------------- <body> <div id='div1'></div> <script>
0
8683
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8904
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8876
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6531
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.