Tuesday, March 3, 2009

Element 'ScriptManager' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing

Dear Reader,


Today i was about to develop a new ajax control for one of my applications. So i was about to refer a sample which i had before. When i opened the project from visual studio 2008, Like...
File -> Open -> Website -> Project Name folder, selected the folder where is project was there in file system.
When i build the project It said couldn't find the reference for AjaxControlToolkit.dll & RssToolkit.dll. It looked mysterious... because it was a working project. Then I added the references and when i built the solution, the build was successful but when i browser the site the Ajax functionalities were not working. it showed the script warnings in the left bottom corner of the browser! Its weird to see the working application going wrong even though we have not modified it recently.

When i looked into the design code, I noticed that the element <asp:ScriptManager was showing the following warning message.

"Element 'ScriptManager' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing."

Then i googled for the above message & was trying solutions suggested by MS Asp.Net Forum & Matthew Cosier but the warning message was still appearing

Looking into the project file, i realized that the folder structure is like
Project Name -> Website -> bin,image,css & aspx pages.

Now i found what could have went work &and realized why it said that it couldn't find the reference for AjaxControlToolkit.dll & RssToolkit.dll earlier.
The project folder which we open from visual studio matters.

Now i opened like File -> Open -> Website -> Project Name folder -> Website Folder.
Now every thing works fine & so are the ajax functionalities in control :)

Regards
Fauzi




No comments: