Solved

AjaxControlToolkit in SharePoint

Posted on 2012-03-27
7
803 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

688 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