0

I am upgrading sharepoint 2010 solution webpart to 2013.

Foll. is the procedure I follow:-

  1. Edit your .csproj file and add to it -> 15.0
  2. Go to project properties and set framework as 4.5
  3. Go to package and under properties of the package set the version to 15.0
  4. Do a find replace for 14.0.0.0 to 15.0.0.0.
  5. Check each file to do a check for any hive references. You'll need to add a /15/ to these. EG: _layouts/ to _layouts/15/ and also for CONTROLTEMPLATES as CONTROLTEMPLATES/15
  6. Download AJAX version 4.5 and update reference of AJAX dll in project
  7. NO Change have been done to master page
  8. Do right click on project and Click Clean to clean solution
  9. Build the solution, then Deploy your solution

When I add a webpart to a site page it gives error as:-

The requested script resource 'MaskedEdit.MaskedEditValidator.js' requires version 'AjaxControlToolkit, Version=4.5.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' of the ASP.NET AJAX Framework. To use this resource, make sure that the application references version 'AjaxControlToolkit, Version=4.5.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e'.

The error goes away if I remove the foll. line from code, however, only the images on webpart are visible and I can no longer edit this page (option dissapears, appears only when I remove webpart using ?contents=1):-

  <cc1:MaskedEditExtender TargetControlID="txtBookingStart" Mask="99/99/9999" MaskType="Date" runat="server" ID="MaskedEditExtender_txtBookingStart">
                                    </cc1:MaskedEditExtender>
                                    <cc1:MaskedEditValidator runat="server" ID="MaskedEditValidator_txtBookingStart" ControlExtender="MaskedEditExtender_txtBookingStart" ControlToValidate="txtBookingStart" InvalidValueMessage="Invalid booking start date" Display="None">
                                    </cc1:MaskedEditValidator>

Any idea what is happening?

2
  • Do you have Ajax Control Toolkit installed other than 4.5 version? If so, you will have to remove it from the system ! Feb 20, 2014 at 7:18
  • I have reverted back to AJAX version 3.0.30930.28736 and it all works well! Looks like newer versions of AJAX donot work with SP2013 as well just like they caused issued in SP2010! But this MSDN forum does say that we can use 4.5.. social.technet.microsoft.com/Forums/sharepoint/en-US/…
    – variable
    Feb 21, 2014 at 5:29

2 Answers 2

0

I think you ar missing an Import in your .ascx-file:

<%@ Register Assembly="AjaxControlToolkit, Version=4.5.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

Add this to the other lines in the top of the .ascx of yur visual webpart.

Seems to be more to it for SP 2013:

Here is a guide: http://sampathnarsingam.blogspot.in/2012/05/how-to-make-ajax-control-toolkit.html

You will need to update your Master Page to add the Script manager, among other things.

9
  • The import line is as follows:- <%@ Register Assembly="AjaxControlToolkit, Version=4.5.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    – variable
    Feb 20, 2014 at 7:15
  • If I use the line provided by you I get the error as:- Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified
    – variable
    Feb 20, 2014 at 7:17
  • So it seems the assembly is correctly added to the gac! How are you deploying it? Feb 20, 2014 at 7:18
  • I have downloaded the AJAX toolkit version 4.5, unzipped and copied over the DLL to a location on C:\. Then, I removed existing reference for AJAX toolkit from project and added this one. Then, I did a debug via VS. Added webpart to page. But I can see only the images located on webpart and the option to edit/save page is dissapeared! Cant I use the existing 3.5 version ? Do I have to compulsorily use the 4.5 version?
    – variable
    Feb 20, 2014 at 7:20
  • Have you followed all instrcutions here: ajaxcontroltoolkit.codeplex.com/… Feb 20, 2014 at 7:23
0

I have reverted back to AJAX version 3.0.30930.28736 and it all works well! Looks like newer versions of AJAX donot work with SP2013 as well just like they caused issued in SP2010!

However, this MSDN forum does say that we can use 4.5.. http://social.technet.microsoft.com/Forums/sharepoint/en-US/60fa19fe-86a0-446b-b61f-11a82fe4287f/how-to-implement-ajax-toolkit-for-sharepoint2013?forum=sharepointdevelopment&prof=required

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.