Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am getting an error when using place holders like "<%=errmsgs[1]%>" in javascript. I used CalanderExtender ajax control. For validation of dates, I used javascript. Please help me to rectify this error.

Error Details:
C#
Exception Information : The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Source Information : System.Web
Stack Information :
   at System.Web.UI.ControlCollection.Add(Control child)
   at AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control)
   at AjaxControlToolkit.ExtenderControlBase.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Thanks in advance,
Janes
Posted
v2

1 solution

Please use '#' instead of '=' for example use "<%#errmsgs[1]%>" instead of "<%=errmsgs[1]%>". And one more thing is add Page.Header.Databaind in your master page code file in page load event.


Hope this will work for you.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900