Hi
I have been trying to integrate YAF into an mvc web application. I have created an mvc4 website template and added YAF to a sub folder. This runs ok from the default.aspx that comes with the forum. When i try to create an mvc content page using an aspx master page I get problems relating to the CSS classes.
if or Styles.Render("~/Content/css") is included in the master page then the YAF CSS throws an exception :
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
System.Web.UI.ControlCollection.Add(Control child) +9600971
YAF.Core.Services.PageElementRegister.RegisterCssInclude(Control element, String cssUrl) +116
YAF.Core.Services.PageElementRegister.RegisterCssIncludeResource(String cssUrlResource) +110
YAF.Modules.PopupDialogNotification.OnPreRender(EventArgs e) +391
System.Web.UI.Control.PreRenderRecursiveInternal() +83
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974
Ive looked into this but cant work out why this is happening. does anybody know why this is or how to get around this? If not is there another way to use YAF inside an mvs master page or layout.cshtml?
Thanks
Paul