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 50:             metaKeyword.Name = "Keyword";
Line 51:             metaKeyword.Content = ds.Tables[0].Rows[0]["keyword"].ToString();
Line 52:             Page.Header.Controls.Add(metaKeyword);
Line 53:             Page.Header.Controls.Add(metaDescription);
Line 54: 

Source File: c:\inetpub\vhosts\rajtradingcorp.com\httpdocs\category.aspx.cs    Line: 52

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) +11660844
   category.LoadCat() in c:\inetpub\vhosts\rajtradingcorp.com\httpdocs\category.aspx.cs:52
   category.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\rajtradingcorp.com\httpdocs\category.aspx.cs:22
   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.4700.0