Last post Feb 11, 2009 11:46 AM by jstrosch
Feb 05, 2009 07:02 AM|jgd12345|LINK
Hi, am i missing something but why does the following alert hello when clicking on test:
Appreciate your help. Thanks
Feb 11, 2009 11:46 AM|jstrosch|LINK
I'm going to give this a try. When you use the inline version
turns it into:
If you use asp.net you could create a hyperlink control:
<asp:HyperLink id="lnk" runat="server">Link</asp:HyperLink>.
Then, in the code-behind, you could assign a string after using the AntiXss.HtmlAttributeEncode function to the NavigateUrl property. For this example, let's say that you have something like this:
If you step through this code just after tmpSt has the value assigned you'll see the same encoding:
You can see that all of the ampersands in the encoded string have been themselves encoded. The other thing I noticed is that none of the other characters were re-encoded, such as the # character. If you ran HtmlAttributeEncode twice on the same string the second pass you would end up with this:
Hope this helps out...