
SelAromDotNet
Top achievements
Rank 2
SelAromDotNet
asked on 06 Jan 2009, 09:56 PM
I'm having trouble with the rad menu in the latest sitefinity (3.5 sp1) where the links are not correctly escaping the ampersand (&) symbols in my link text. Take a look here: http://www.mcallen.net/golf/home.aspx. the menu up at the top under driving range (Fees & Memberships) and Contact Us (Maps & Directions) have ampersands, but they are not escaped to & by the menu. I tried manually chaning the link text and putting the full escaped text myself, but it still shows up as &.
can someone tell me what I'm doing wrong?
thanks!
can someone tell me what I'm doing wrong?
thanks!
5 Answers, 1 is accepted
0
Hi SelArom,
This is by design - the text of the menu items is not html encoded. The same behavior can be observed by the built-in ASP.NET menu control and the HyperLink control.
You should replace the"&" in the text of the items with "&":
foreach (RadMenuItem item in RadMenu1.GetAllItems())
{
item.Text = item.Text.Replace("&", "&");
}
Regards,
Albert
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
This is by design - the text of the menu items is not html encoded. The same behavior can be observed by the built-in ASP.NET menu control and the HyperLink control.
You should replace the"&" in the text of the items with "&":
foreach (RadMenuItem item in RadMenu1.GetAllItems())
{
item.Text = item.Text.Replace("&", "&");
}
Regards,
Albert
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

SelAromDotNet
Top achievements
Rank 2
answered on 07 Jan 2009, 02:36 PM
thank you for your prompt reply! is there a reason this doesn't happen by default?
0

SelAromDotNet
Top achievements
Rank 2
answered on 07 Jan 2009, 02:40 PM
wait, this isn't working. I'm assuming that this code goes in the page_load method? I've done this, but the text is still coming out unescaped...
0
Hello SelArom,
Perhaps the menu is populated later than Page_Load. You can try setting the text later - during Page_PreRender for example.
Regards,
Albert
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Perhaps the menu is populated later than Page_Load. You can try setting the text later - during Page_PreRender for example.
Regards,
Albert
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

SelAromDotNet
Top achievements
Rank 2
answered on 07 Jan 2009, 03:15 PM
oops my mistake for some reason I put it in preinit. not sure how that happened! I moved it to page load and now it works fine, thanks!
any plans to make this the default behavior?
thanks again!
any plans to make this the default behavior?
thanks again!