473,232 Members | 1,647 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,232 software developers and data experts.

& problem with hyperlink control

I have been searching online for a whole day and couldn't find an
answer for this. I have this hyperlink server control:

------------------------------------------------
<asp:HyperLink ID="hylForms" Runat="server"
NavigateUrl="#">Forms</asp:HyperLink>

Codebehind:

protected HyperLink hylForms;

hylForms.NavigateUrl = "?Dept=" + Request.QueryString["Dept"] +
"&Sect=forms";
------------------------------------------------

Very straight forward right? I think so too but when it renders the
HTML the "&Sect" part turned into "&amp;Sect" and the whole link would
be

?Dept=HR&amp;Sect=forms
Thinks I have tried already:

- Delete the dll and recomplie
- Different server
- Move all the code on the asp.net page and no codebehind
- Try different HTML characters (eg "<") that supposingly will render
as well but only "&" will turn into "&amp;"
Could someone give me a clue?

Thanks in advance.

Nov 19 '05 #1
6 4494
In C# try
\&

In VB.Net try
&&

Just as a test once.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"FoundThisOnline" wrote:
I have been searching online for a whole day and couldn't find an
answer for this. I have this hyperlink server control:

------------------------------------------------
<asp:HyperLink ID="hylForms" Runat="server"
NavigateUrl="#">Forms</asp:HyperLink>

Codebehind:

protected HyperLink hylForms;

hylForms.NavigateUrl = "?Dept=" + Request.QueryString["Dept"] +
"&Sect=forms";
------------------------------------------------

Very straight forward right? I think so too but when it renders the
HTML the "&Sect" part turned into "&Sect" and the whole link would
be

?Dept=HR&Sect=forms
Thinks I have tried already:

- Delete the dll and recomplie
- Different server
- Move all the code on the asp.net page and no codebehind
- Try different HTML characters (eg "<") that supposingly will render
as well but only "&" will turn into "&"
Could someone give me a clue?

Thanks in advance.

Nov 19 '05 #2
this:
HyperLink1.NavigateUrl = "/test/test.ext?test&test2"

produced this:
http://localhost/test/test.ext?test&test2

As expected (done in vb.net).

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"FoundThisOnline" wrote:
I have been searching online for a whole day and couldn't find an
answer for this. I have this hyperlink server control:

------------------------------------------------
<asp:HyperLink ID="hylForms" Runat="server"
NavigateUrl="#">Forms</asp:HyperLink>

Codebehind:

protected HyperLink hylForms;

hylForms.NavigateUrl = "?Dept=" + Request.QueryString["Dept"] +
"&Sect=forms";
------------------------------------------------

Very straight forward right? I think so too but when it renders the
HTML the "&Sect" part turned into "&Sect" and the whole link would
be

?Dept=HR&Sect=forms
Thinks I have tried already:

- Delete the dll and recomplie
- Different server
- Move all the code on the asp.net page and no codebehind
- Try different HTML characters (eg "<") that supposingly will render
as well but only "&" will turn into "&"
Could someone give me a clue?

Thanks in advance.

Nov 19 '05 #3
Tried in C# but got

Unrecognized escape sequence

Nov 19 '05 #4
I believe this is more of a C# problem than VB

Nov 19 '05 #5
In C#, this:
HyperLink1.NavigateUrl = "/test/test.ext?test1&test2";

Produced this:
http://localhost/test/test.ext?test1&test2

As expected.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"FoundThisOnline" wrote:
I believe this is more of a C# problem than VB

Nov 19 '05 #6
It's amazing how I found the solution now but not the entire day
yesterday!

Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");

That will just take care of the problem!

Nov 19 '05 #7

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

Similar topics

1
by: Zaidan | last post by:
I am running Excel2000 under WIN98 2nd edition, and I am writing a VBA code (I will consider using javascript if I have to) that does the following, at the user command: 1- Start MS Explorer and...
2
by: P. Mellerin | last post by:
Hello, I have been searching online for a whole day and couldn't find an answer for this. I have this hyperlink server control: ...
3
by: Fred R | last post by:
I'm designing an app in Access 97 that will facilitate the uploading of records and images to a website. The user selects the image thumbnails from the file system and drags them into the app....
4
by: Andy Breward | last post by:
Hi I have created a range of usercontrols for displaying various bits of information. My question is if I wish to pass a parameter to the UserControl from the host page, is this possible? I...
1
by: D. Shane Fowlkes | last post by:
Hello All. I keep asking for help with this on the www.asp.net forums and nobody seems to be able to help. What I'm trying to accomplish is very simple. I simply want to create a Hyperlink...
1
by: I am Sam | last post by:
I need to pass an id from one record to a different page. The ID is in a Datagrid and I want to pass the record to another page. Example: http://www.domain.com?RecordID=2 the parameter I want to...
0
by: Seok Bee | last post by:
Dear Experts, I am having a wizard control in my web app. I have some textbox controls within the wizard control. At the same time, I have a hyperlink to run a pop-up window for calendar. The...
7
by: Arpan | last post by:
Both the Hyperlink web server control & the LinkButton web server control display text as links; so what are the differences between the 2 web server controls? Thanks, Arpan
2
by: nani | last post by:
Hi friends I am creating one web application in that i take one hyperlink control.when i click hyperlink control.how to split the page in two parts and display the result in that secound part If...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.