Monday, January 24, 2011

Smart tag not working in visual studio

Recently in couple of threads in asp.net I saw a couple of questions regarding Common tasks such as add extender not showing in the web controls. If you are wondering what these common tasks are then, it’s a shortcut menu available for your web server control that helps you extend the functionality of your control such as  the “Add Extender” menu you can see below. When you click on Add Extender menu it generally pops up a dialog with a list of extender controls that you can use with your current control.

The problem can be generally resolved by enabling the smart tag. To do so
1.       Right click on the control.
2.       You can see “Show Smart Tag” menu as below.

3.       Check the menu, if it’s not. Now you will be able to see the menu as above.

But sometime this menu is greyed out or disabled. The problem is due to the mismatch version of your ajaxtoolkit and that of your current website target framework version. If the target version of your website is greater than the version of your ajaxtoolkit control then you may not be able to view the menu. If you are not sure which version of AjaxToolkit you are using then just go to the folder where your control toolkit is loaded from. Right click on the dll and view it’s property. Go to details/version tab and check out it’s file version. Generally if the target framework of your website is 3.5 then the version of your AjaxControlToolkit should be 3.5 as well.

Just make sure to download the correct version of AjaxControlToolkit from the CodePlex and reference it in your project. You can find the binary and source code for the ajax control toolkit in code plex.
If you have downloaded the source code for AjaxControlToolkit then you may wanna set the correct assembly version and build it. Just go to the AssemblyInfo file under Property and change the version in AssemblyVersion attribute.
 If you have already added an older verison of AjaxControlToolkit then remove them from your toolbox and add the new one.
And finally make sure to rebuild your website once again.

1 comment:

Rayyan said...

I love you! Solved my issue!