I would like to use ASP.Net themes on my EPiServer site - I have given the web editor a drop down with a list of available themes to choose from.However, there seems to be an issue with ASP.Net themes and the EPiServer URLRewriter not rebasing the generated CSS links.i.e. the link generated by ASP.Net is relative to the physical path rather than the generated path.Example
Has anyone tried this before and come across a solution?
Any help / ideas for a solution would be apprciated.
Okay so fixed it!
I coded a control adapter to set the href correctly.
public class LinkControlAdapter: System.Web.UI.Adapters.ControlAdapter
protected override void Render(System.Web.UI.HtmlTextWriter writer)
System.Web.UI.HtmlControls.HtmlLink HL = this.Control as System.Web.UI.HtmlControls.HtmlLink;
if (HL != null)
HL.Href = VirtualPathUtility.ToAbsolute(HL.Href);
and added a browser file in App_Browser folder.
adapterType="JR.EPI.OAPMain.WebForms.ControlAdapters.LinkControlAdapter, JR.EPI.OAPMain.WebForms, Culture=neutral, PublicKeyToken=null" />
Not sure why VirtualPathUtility.ToAbsolute(HL.Href) works where the HtmlLink's RenderAttributes call to REsolveClientUrl does not but hey as long as it works right!