Solved

AjaxControlToolkit in SharePoint

Posted on 2012-03-27
7
794 Views
Last Modified: 2012-03-28
I heard that if AjaxControlToolkit is used in SharePoint then trouble comes to you.
Because it is conflicting with ScritpManager in master page.

Is it true?
0
Comment
Question by:zhshqzyc
  • 3
  • 3
7 Comments
 
LVL 18

Expert Comment

by:ivan_vagunin
ID: 37775236
Hi! I've used some controls from AjaxControlToolkit (AutoComplete, RoundedCorners, Tabs etc) with SharePoint 2010 and it work just fine. But I've some troubles with AjaxControlToolkit popup window in SharePoint 2007 (as far as I remember it was not about conflicts, but something with HTML markup). So it's depends on SharePoint version.

AjaxControlToolkit ScritptManager  really conflicts with asp.net ScritptManager  and SharePoint 2010 has an asp.net ScritptManager in standard master page, so the solution is to use asp.net ScriptManager (as I said, it works ok) or try to create custom master page (did not try this).
0
 
LVL 7

Expert Comment

by:dhawalseth
ID: 37775967
Hi,
You should have mentioned the Sharepoint Version you are using first of all.
Currently I am using AjaxControlToolkit (3.0.30930) with Sharepoint 2010. It does give  problems.
1. ON some browsers(IE7.0, WIN XP) you will have a javascript error when the page first loads.
2. Higher version of Toolkit is compatible with framework 4.0, but 2010 supports framework 3.5.
3. You need to put in efforts in troubleshooting the partial postbacks using 'Triggers'

I will add more if encountered.
0
 

Author Comment

by:zhshqzyc
ID: 37776339
My SharePoint version is 2010. My visual studio is 2010. I want to pop out a form from an asp.net button. For the safety, I select AjaxControlToolkit 3.0.30930.28736.
Now I can't register the AjaxControlToolKit, if it is not feasible to do it. I will turn my attention to jquery, but it is painful because I am not strong on it.
Would you please look at what is wrong when I tried to register AjaxControlToolkit?
My web.config file:
 
<assemblies>
        <add assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <add assembly="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add assembly="Microsoft.SharePoint.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add assembly="Microsoft.Office.Access.Server.UI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add assembly="Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
	    <add assembly="AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
      </assemblies> 

Open in new window

And
 
<SafeControls>
	  <SafeControl Assembly="AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" Namespace="AjaxControlToolkit" TypeName="*" Safe="True" />

Open in new window

      
Also
 
<controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
		<add tagPrefix="cc1" assembly="AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"
    namespace="AjaxControlToolkit" />
      </controls>

Open in new window

In the default.master file.
<%@Master language="C#"%>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="MUISelector" src="~/_controltemplates/MUISelector.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>
  <%@ Register Assembly="AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"
    Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

Open in new window

My web page:
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Admin.aspx.cs" Inherits="QBM_Admin.Layouts.QBM_Admin.Admin"
    DynamicMasterPageFile="~masterurl/default.master" %>
<%@ Register Assembly="AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"
    Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

Open in new window

0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:zhshqzyc
ID: 37776406
ErrorAttached is my error snapshot.
The first line.
0
 
LVL 18

Expert Comment

by:ivan_vagunin
ID: 37777066
It looks like assembly is registered correctly, but cannot be loaded by a framework. Did you copied assemly into GAC?

To show popup in SharePoint 2010 it is better to use SharePoint javascript API.

SP.UI.ModalDialog.ShowModalDialog function can do that and no need to use ajax control toolkit.
http://msdn.microsoft.com/en-us/library/ff410058.aspx
0
 

Author Comment

by:zhshqzyc
ID: 37777151
No, I didn't copy it to GAC because I don't know how to do it.
I want to add some textboxs, buttons and dropdown menu to the pop up form.
Can SP.UI.ModalDialog.ShowModalDialog  do it?

I mean the example like http://jqueryui.com/demos/dialog/
0
 
LVL 18

Accepted Solution

by:
ivan_vagunin earned 500 total points
ID: 37777296
1) To copy assembly into GAC you can use gacutil.exe or just open C:\Windows\Assembly directory in Windows explorer and drag assembly there
http://blogs.msdn.com/b/johnwpowell/archive/2009/01/14/how-to-copy-an-assembly-from-the-gac.aspx

2) SP.UI.ModalDialog.ShowModalDialog show aspx page (e.g. SharePoint application page) in a  popup window. This means that you can create SharePoint application page with any control you like and use SP.UI.ModalDialog.ShowModalDialog to open this page in popup.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question