Solved

AjaxControlToolkit in SharePoint

Posted on 2012-03-27
7
796 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CORS access to MongoDB via Apache Server on Windows 1 68
Archiving SharePoint 2010 sites using PowerShell 5 34
SharePoint Destination SSIS 2 37
Json and ajax 1 18
For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

713 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