473,598 Members | 3,252 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to enforce "&"inside my queryString?

Hi,

I need to pass an URL via a hidden value as follow:

<input type="hidden" id="Test" runat="Server">

and on Page_Load I assign a value to this hidden input as follow:

Test.Value = "http://www.myserver.co m?id=123&name=H omerSimpson";
However when I view the page source "&" is replaced with "&amp;" as the URL
changes to http://www.myserver.com?id=123&amp;name=HomerSimpson

How can I enforce the "&" inside my querystring when written into HTML?

I have tried to Server.UrlEncod e, but the server that I am posting this
hidden value to, does not decode it before returning to the URL, and
unfortuntely I have no control over the way that they handle my hidden value
(URL with &amp;)

Thanks for your time.
Mehdi

Nov 19 '05 #1
2 1621
You might be able to resolve this by writing out the entire value to an
<asp:Literal> control, e.g.

<asp:Literal id="TestLiteral " runat="Server">

TestLiteral.Tex t = String.Format (
@"<input type=""hidden"" value=""{0}"" id=""Test"" runat=""Server" ">",
@"http://www.myserver.co m?id=123&name=H omerSimpson"
);

"Mehdi" <no****@nospam. nowhere> wrote in message
news:u7******** ******@TK2MSFTN GP14.phx.gbl...
Hi,

I need to pass an URL via a hidden value as follow:

<input type="hidden" id="Test" runat="Server">

and on Page_Load I assign a value to this hidden input as follow:

Test.Value = "http://www.myserver.co m?id=123&name=H omerSimpson";
However when I view the page source "&" is replaced with "&amp;" as the URL changes to http://www.myserver.com?id=123&amp;name=HomerSimpson

How can I enforce the "&" inside my querystring when written into HTML?

I have tried to Server.UrlEncod e, but the server that I am posting this
hidden value to, does not decode it before returning to the URL, and
unfortuntely I have no control over the way that they handle my hidden value (URL with &amp;)

Thanks for your time.
Mehdi


Nov 19 '05 #2
MWells,

You were right, it enforces the "&" inside my query string.

Thanks
Mehdi
Nov 19 '05 #3

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

Similar topics

3
17281
by: Arpan | last post by:
A link has the following URL: <a href="Page1.asp?cname=<%= Request.QueryString("cname") %>&cadd1=<%= Request.QueryString("cadd1") %>&cadd2=<%= Request.QueryString("cadd2") %>&cplace=<%= Request.QueryString("cplace") %>">Click</a> Suppose the names in the above querystring have the following values: cname="Danny" cadd1="House 97"
1
8057
by: David Furey | last post by:
Hi I have an XML documnet and a XSLT document as shown below THe XSLT document brings back a filtered docmument that has the VendorName that starts with a particular sub-string This works as expected with alphabet and number characters and the ' (single quote &apos; entity) character but does not work if a double quote character " is part of the string to filter on This returns all Vendor Names that begin with A (either case)
0
1089
by: Martin Maurer | last post by:
Hello, i have a problem with NameValueCollection.Add or better with converting to a QueryString: NameValueCollection myQueryStringCollection = new NameValueCollection(); myQueryStringCollection.Add("Test1", null); myQueryStringCollection.Add("Test2","abc"); WebClient myWebClient = new WebClient(); myWebClient.QueryString = myQueryStringCollection;
5
2285
by: chortler | last post by:
When I use the meta tag to refreh my asp webpage, it doesn't change Ispostback to false; It always equals true? Any ideas??
2
2549
by: beachboy | last post by:
I have a problem if the parameter has a "&" symbol in querystring, i think asp.net will split the value into 2 values as "&" is a spliter any advise can give me to solve this problem? P.S. I can't restrict user don't input "&" symbol when input Thanks in advanced.
1
2923
by: EoRaptor013 | last post by:
Not sure where to ask this question, but... I'm using a TreeView component to enable browsing file folders in a specific directory (for test purposes /Program Files/). Some users use an ampersand ("&") in both folder and file names. This has caused me some real grief! I'm not in a position to tell the users it's an ID 10 T error and they have to change their file and folder names. In VS2K5, I have debugged my code and found that ...
3
1532
by: Tanmaya Kulkarni | last post by:
Hi, I need to pass a string having ampersand "&" in the query string like Company=Johnson&Johnson. How do I send it and receive it? TIA, Tanmaya
2
2068
by: Me | last post by:
I am passing on the input name to my asp page using Response.redirect "mypage.asp?name=" & name and the resulting url looks like 'companyname/mypage.asp?name=" & name I would like it to appear like 'companyname' or at most 'companyname/mypage.asp' how can I do it?
30
3806
by: Medvedev | last post by:
i see serveral source codes , and i found they almost only use "new" and "delete" keywords to make they object. Why should i do that , and as i know the object is going to be destroy by itself at the end of the app for example: class test { public: int x;
0
7987
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
8392
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...
0
8397
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8050
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
8264
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...
0
6718
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5850
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
5438
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
3939
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.