Solved

AjaxControlToolkit in SharePoint

Posted on 2012-03-27
7
782 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:zhshqzyc
Comment Utility
ErrorAttached is my error snapshot.
The first line.
0
 
LVL 18

Expert Comment

by:ivan_vagunin
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now