problem with & in hyperlink.navigate (which is converted to &)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

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

------------------------------------------------------------------------------------
Design mode:

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

Code-behind:

protected HyperLink MyHyperlink;

MyHyperlink.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

And the problem is that VPN doesn't like that kind of malformed urls.

I am using VS.NET 2003 & VS.NET 2005 (beta).

So, if someone have any idea... :)

Thanks in advance.

P. Mellerin
 
P,

I'm not quite sure what you're asking. If set the NavigateUrl property as
shown below, the link works fine, doesn't it?
 
The link works fine, it's true. Anyway, it is a malformed url
(http://...?param1=a&amps;param2=b...). And with a reverse-proxy connection,
it is a bad thing... : it intercepts only "&", not "&"... :(((

Is it a Dotnet's "bug by design" ?

CT said:
P,

I'm not quite sure what you're asking. If set the NavigateUrl property as
shown below, the link works fine, doesn't it?

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk

P. Mellerin said:
Hello,

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

------------------------------------------------------------------------------------
Design mode:

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

Code-behind:

protected HyperLink MyHyperlink;

MyHyperlink.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

And the problem is that VPN doesn't like that kind of malformed urls.

I am using VS.NET 2003 & VS.NET 2005 (beta).

So, if someone have any idea... :)

Thanks in advance.

P. Mellerin
 
Back
Top