Mangling of HTML Anchor Links in Editor

Topics: ASP.NET 2.0, Business Logic Layer, Controls, Themes
Sep 22, 2012 at 2:22 PM
Edited Sep 24, 2012 at 12:59 PM

When I create the following link:

<a href="~/Contact.aspx" runat="server">Contact us</a>

The editor strips out the runat attribute, breaking the link. It's also inserting "/page" into the URL which I do not want to happen. Is there some editor setting to prevent this from happening? I've checked here and couldn't find an answer.


I've added the following to tinyMCE.acsx to allow the addition of the runat attribute to anchor links:

tinyMCE.init({ ... extended_valid_elements : "a[href|runat=server|title|target]" ... }); 

This solves the problem with the runat attribute being stripped out. My only remaining problem is the automatic insertion of "page" in the URL. Anybody?

I'm looking at this but having difficulty in determining the final version of the required code change. It seems that 2.5 introduced changes that prevent previous workarounds.

Sep 25, 2012 at 4:21 PM
Edited Sep 25, 2012 at 4:22 PM

I'm offering a StackOverflow bonus of 50 points to anybody that can up with code to fix this issue :-)