Server Error in '/' Application.

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:


Line 80:         js.Attributes.Add("type", "text/javascript")
Line 81:         js.Attributes.Add("src", Page.ResolveUrl("/js/tiny_mce/tiny_mce.js"))
Line 82:         Header.Controls.Add(js)
Line 83: 
Line 84:         'link = New htmllink

Source File: C:\Webovi\mojtv.net\m2\forum\novatema.aspx.vb    Line: 82

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) +11660348
   m2_forum_novatema.buildHeaderStuff() in C:\Webovi\mojtv.net\m2\forum\novatema.aspx.vb:82
   m2_forum_novatema.Page_Load(Object sender, EventArgs e) in C:\Webovi\mojtv.net\m2\forum\novatema.aspx.vb:21
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4676.0