Solved

AjaxControlToolkit in SharePoint

Posted on 2012-03-27
7
793 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

There is one common problem that all we SharePoint developers share: custom solution deployment. This topic can't be covered fully in this short article, so all I want to do in this one is to review it from a development-to-operations perspectiv…
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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