Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HyperLink control and HTML encoding

Reply
Thread Tools

HyperLink control and HTML encoding

 
 
John A.
Guest
Posts: n/a
 
      06-07-2010
If I have a hyperlink control like this:

<asp:HyperLink ID="HyperLink1" runat="server"
Text="&'><"
ToolTip="&'><"
NavigateUrl="~/">
</asp:HyperLink>

it renders as:

<a id="HyperLink1" title="&amp;'>&lt;" href="/">&'><</a>

Am I to understand that the Text attribute's value is never encoded, and
the ToolTip's value is encoded by default? If so, according to what
rules, since the > is not converted to &gt;?
 
Reply With Quote
 
 
 
 
Andrew Morton
Guest
Posts: n/a
 
      06-07-2010
John A. wrote:
> If I have a hyperlink control like this:
>
> <asp:HyperLink ID="HyperLink1" runat="server"
> Text="&'><"
> ToolTip="&'><"
> NavigateUrl="~/">
> </asp:HyperLink>
>
> it renders as:
>
> <a id="HyperLink1" title="&amp;'>&lt;" href="/">&'><</a>
>
> Am I to understand that the Text attribute's value is never encoded,
> and the ToolTip's value is encoded by default? If so, according to
> what rules, since the > is not converted to &gt;?


It looks like the Text attribute is taken literally - otherwise you couldn't
put any markup in it.

As long as all the < are encoded, the > don't need to be.

--
Andrew


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink davetichenor ASP .Net 1 10-30-2006 02:57 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink Dave ASP .Net Datagrid Control 0 10-21-2006 07:48 PM
Encoding.Default and Encoding.UTF8 Hardy Wang ASP .Net 5 06-09-2004 04:04 PM
HTML Client Control versus. HTML Server Control versus. Web Server Control Matthew Louden ASP .Net 1 10-11-2003 07:09 PM
Dynamically Hyperlink and Event Handler for the Hyperlink ? Ken ASP .Net Datagrid Control 1 08-15-2003 11:38 PM



Advertisments