I am using AjaxControlTookit in my website. The website was running fine until I added the HTMLEditorExtender. Then the exception which came was
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
I resolved it using a suggestion on one of the questions on stackoverflow.com only. Solution was to delete the ajax control kit tab from the toolbox and then again add the tab and the items and update the dll file.
I updated the DLL file and performed the steps given there. But now the compile time error is coming. Which is as follows
Error 4 Could not load file or assembly 'AjaxControlToolkit, Version=4.1.60501.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Please tell me what is the solution to this.
Make sure you are adding a scriptmanager to the page before you use any controls. Also, if you are using javascript, try moving your code to the bottom of the page. I have found that if I dynamically add content to the head of the application, from the codebehind, I will get a similar error.
Look for System.Web.Extensions.Design in assembly folder and refer in you code accordingly.
Thanks everyone I solved this puzzle by resetting it to previous error situation i.e.
You can check the solution here: Error after adding AjaxControlToolkit's HTMLEditorExtender which is my another question for this error.