Thursday, January 22, 2009

Installing AJAX Control Toolkit For Visual Studio 2005

My previous blog was based on my experience with “System.Web.Extensions” dll. You would have read the bucket full of hardships I had to face. This blog is continuation of the hardship I faced in the same project when I tried adding the Ajax Control toolkit for Visual Studio (VS 2005). This time I was lucky not to face too much problem.

As the project was using ASP.NET AJAX 1.0 controls I needed to install the same controls in the toolbox of VS so that I can use them in the project, also this will help me to just drag the controls and place them on ASP.NET pages. The steps to install the AJAX control toolkit for .NET Framework 2.0, ASP.NET AJAX 1.0 and Visual Studio 2005 are

  1. Obviously the first step is to download the toolkit. So what you are waiting for, download the toolkit from here. (http://www.codeplex.com/AjaxControlToolkit/release/projectreleases.aspx?releaseid=11121)

  2. Once you have downloaded the toolkit there are two ways in which you can proceed. Unpack/Unzip the whole contents or just find and unpack/unzip “AjaxControlToolkit.dll” alone.

  3. Next, open VS 2005 and right click on the toolbox' and select “Add Tab” option from the menu and give a name.

image
  1. Right click the new group and select “Choose Items” from the menu.

image
  1. From the “Choose Toolbox Items” dialog box’s “.NET Framework Components” tab click the browse button. Navigate to the folder where you have unzipped the “AjaxControlToolkit.dll” (If you have Unpacked/Unzipped the whole content of the zip file then you can find the dll in “SampleWebSite\Bin” folder.). Select the “AjaxControlToolkit.dll” and click open.

image
  1. Once you click open from Open File dialog box, “Choose Toolbox Items” dialog will highlight all the controls embedded in the dll. Finally select the control you want to add in the toolbox and click “Ok”. By default all the new controls will be highlighted and check marking one control will check mark the whole AJAX controls. The screen shot sorted based on the AJAX controls is pasted below.

image

After checking all the controls I clicked “Ok”. What the heck another error? My date with errors is not gonna get over in this project. Oh no!!

I tried once again but all in vain. The below error kept on popping up.

“There was an error loading types from assembly 'C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\AjaxControlToolkit.dll’”

Googling was in vain. Different combination of searches with different keywords didn't help either. I don't know what went in my mind, I opened another instance of VS 2005 and created a dummy web application and tried adding the AJAX Control’s dll and voila the controls got added. How weird, I was thinking? Oh Microsoft, I have heard people saying many weird things happen with Microsoft softwares, here I am facing one such thing. :) Anyway my prob was solved.

I went to the previously opened instance of VS to check whether the newly added toolbox had any impact. No, obviously there will be no impact, so to try my luck once again I followed the above steps to add the controls. But again the same error. What *#*#*$*&*##? Ok, let me close the current instance of VS and open a new instance and try it. I did the same, closed VS and opened a new instance of VS. Just to make sure that the project in which I am working is not the culprit I opened the project. On inspecting the toolbox there you have it, the “AjaxControlToolkit”. Wow at last everything is falling in place. After this incidence I concluded, in future, if I have some problem like this I will follow either of the steps listed below. I would request others also to do the same. Who knows when the system behaves so weirdly? Any one of the below step may solve your problem.

  • Try adding items to the current instance of VS, if that doesn't help then

  • Open a new instance of the software and try installing the items, if that also doesn't help then

  • Restart the system and try installing the items, if that also doesn't help then

  • Try reinstalling the software (VS) and then try once again, if that also doesn’t help then god bless you. :)

The last step of reinstalling VS was suggested by many in various forums and they have confirmed that reinstalling has solved their problem. Anyway one of the above steps should solve your problem.

Know more,

Sandeep

10 comments:

  1. Thanks sandeep, was getting the same error message but finally worked. i read somewhere for the install to succeed you have to open a project first. no project opened, no install. guess its one of those microsoft things :-)

    ReplyDelete
  2. sandeep dude for me calendar control is not working,however it didnt had any errors even then the calendar is not popping up..

    the source is:


    form id="form1" runat="server"
    div

    asp:ScriptManager ID="ScriptManager1" runat="server"/

    asp:CalendarExtender ID="CalendarExtender1" TargetControlID="TextBox1" runat="server"/


    asp:TextBox ID="TextBox1" runat="server"
    /asp:TextBox

    /div
    /form


    i have not used the tags as it is not allowing me to publish..
    pl help me with the code..

    ReplyDelete
    Replies
    1. may be you are using visual studio 2005...for that you need to use ajax enabled website template

      Delete
  3. thanks for the tutorial ,,,this is awesome but tell me how to add oxford dictionary to the sql server database 2005

    ReplyDelete
  4. thanks for the tutorial ,,,this is awesome but tell me how to add oxford dictionary to the sql server database 2005

    ReplyDelete
  5. thanks for your information..
    anyway, i followed the steps after opened project, and not getting error :)

    ReplyDelete
  6. It is really a great work and the way in which u r sharing the knowledge is excellent.Thanks for helping me to understand basic concepts. As a beginner in Dot Net programming your post help me a lot.Thanks for your informative article.
    Dot Net Training in chennai | Dot Net Training in velachery

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete


  8. Given so much information in it. its very useful .perfect explanation about Dot net framework.Thanks for your valuable information. dot net training and placement in chennai | dot net training and placement in chennai

    ReplyDelete

Please provide your valuable comments.