CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: NewsGroup Date Entered: 1/31/2008 8:44:59 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 7 Views: 87 Favorited: 0 Favorite
8 Items, 1 Pages 1 |< << Go >> >|
normus.maximus
Asp.Net User
Unable to add AJAX web parts1/31/2008 8:44:59 PM

0

Hi, I've been trying to find a solution on my own for a few days without any resolve, so I'm hoping someone can help me out.   I can't seem to add any sort of AJAX web part to our sharepoint sites.  I've also done my best to rule out as many factors as possible, so the web part is strictly an update panel with no other code.  However, I have tried several other ajax web part tutorial .dll's with no change in success.

I've made the changes to the web.config file as noted in several places.  A few specific parts...here are the controls I've listed in the web.config file:

 

<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>

<add tagPrefix="ajax" namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<add tagPrefix="ajax" namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<add tagPrefix="ajax" namespace="Microsoft.Web.Preview.UI" assembly="Microsoft.Web.Preview"/>

<add tagPrefix="ajax" namespace="Microsoft.Web.Preview.UI.Controls" assembly="Microsoft.Web.Preview"/>

I've tried adding the compiled and signed .dll to the GAC to have it fully trusted, added the following line to the default.master:

<asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server"></asp:ScriptManager>

However, I still get the following error when I attempt to add an ajax web part to a site:

 

Unable to add selected web part(s).

<Web Part Name> Web Part: Cannot import this Web Part.

 

And I get this error when attempting to preview the web part in the Web Parts Gallery:

 

Cannot import this Web Part.   at Microsoft.SharePoint.WebPartPages.WebPartImporter.CreateWebPart(Boolean clearConnections)
   at Microsoft.SharePoint.WebPartPages.WebPartImporter.Import(SPWebPartManager manager, XmlReader reader, Boolean clearConnections, Uri webPartPageUri, SPWeb spWeb)
   at Microsoft.SharePoint.WebPartPages.WebPartPreview.get_WebPart()
   at Microsoft.SharePoint.WebPartPages.WebPartPreview.CreateChildControls()
   at System.Web.UI.Control.EnsureChildControls()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint

 

Does anyone have any suggestions?  Much appreciated!

shuklaanupam
Asp.Net User
Re: Unable to add AJAX web parts2/2/2008 9:10:38 AM

0

hi,

  follow the link... and do all changes on webconfig file..

http://www.infinitetiers.com/ajax_config.html

make sure that u hav installed ajax ctrltoolkit.

for a simple ajax webpart u can download the code from MSDN..

hope it will help..

anupam....

vinz
Asp.Net User
Re: Unable to add AJAX web parts2/4/2008 12:51:39 PM

0

Take a look at my article

http://www.koffeekoder.com/ArticleDetails.aspx?id=340_Creating_Ajax_Enabled_Webparts 


Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post fixed your problem.

Blog

normus.maximus
Asp.Net User
Re: Unable to add AJAX web parts2/4/2008 2:53:16 PM

0

Anupam-

 Thanks for the link, I've double checked that all those changes are made to the web.config and default.master file, but I'm still unable to get AJAX web parts to import successfully...

shuklaanupam
Asp.Net User
Re: Unable to add AJAX web parts2/5/2008 12:42:51 PM

0

hi try out this code if u hav done all setting well then this will surely execute... 
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml.Serialization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.WebPartPages;
using System.Drawing;
using System.Windows.Forms;



namespace ajaxwebnote
{

    /// <summary>
    /// Description for WebPart1.
    /// </summary>
    [DefaultProperty("Text"),
        ToolboxData("&lt;{0}:WebPart1 runat=server></{0}:WebPart1>"),
        XmlRoot(Namespace = "ajaxwebnote")]
    public class SayHelloWebPart : Microsoft.SharePoint.WebPartPages.WebPart
    {
        private System.Web.UI.WebControls.Label displayName;
        private System.Web.UI.WebControls.TextBox inputName;
        private System.Windows.Forms.TextBox tb1;
        
        protected override void CreateChildControls()
        {
            
                     
            base.CreateChildControls();

   //Fix for the UpdatePanel postback behaviour.
   EnsurePanelFix();

   LinkButton sayHello = new LinkButton();
   UpdatePanel refreshName = new UpdatePanel();
   ScriptManager scriptHandler = new ScriptManager();
   displayName = new Label();
   inputName = new TextBox();
   
   //Set up control properties.
   this.displayName.ID = "displayName";
   this.displayName.Text = "Hello!";
   this.inputName.ID = "inputName";
              
            
   sayHello.ID = "sayHello"; 
   sayHello.Text = "Say Hello";
   scriptHandler.ID = "scriptHandler";
   refreshName.ID = "refreshName";
   refreshName.UpdateMode = UpdatePanelUpdateMode.Conditional;
   refreshName.ChildrenAsTriggers = true;
   
     //Add the EventHandler to the Button.
   sayHello.Click += new EventHandler(ClickHandler);

   //Add the user interface (UI) controls to the UpdatePanel.
   refreshName.ContentTemplateContainer.Controls.Add(this.inputName);
   refreshName.ContentTemplateContainer.Controls.Add(sayHello);
   refreshName.ContentTemplateContainer.Controls.Add(this.displayName);
   refreshName.ContentTemplateContainer.Controls.Add(this.tb1);
    

   //The ScriptManager control must be added first.
   this.Controls.Add(scriptHandler);
   this.Controls.Add(refreshName);

}
               private void ClickHandler(object sender, EventArgs args)
        {
            this.displayName.Text = "Hello, "
              + this.inputName.Text.ToString() + ".";
        }


        private void EnsurePanelFix()
        {
            if (this.Page.Form != null)
            {
                
                String fixupScript = @" 
     _spBodyOnLoadFunctionNames.push(""_initFormActionAjax"");
     function _initFormActionAjax()
     {
       if (_spEscapedFormAction == document.forms[0].action)
       {
         document.forms[0]._initialAction = 
         document.forms[0].action;
       }
     }
     var RestoreToOriginalFormActionCore = 
       RestoreToOriginalFormAction;
     RestoreToOriginalFormAction = function()
     {
       if (_spOriginalFormAction != null)
       {
         RestoreToOriginalFormActionCore();
         document.forms[0]._initialAction = 
         document.forms[0].action;
       }
     }";
                ScriptManager.RegisterStartupScript(this,
                  typeof(SayHelloWebPart), "UpdatePanelFixup",
                  fixupScript, true);
            }
        }
        protected override void RenderWebPart(HtmlTextWriter output)
        {

            output.WriteLine("&lt;style>.StyleRemark { width:100%;height:100; }</style>");

            output.WriteLine("&lt;TABLE id=\"Table1\" cellSpacing=\"1\" cellPadding=\"1\" width=\"100%\"height=\"100%\" border=\"0\"&gt;");
            output.WriteLine("&lt;TR><TD>");

            
            output.WriteLine("&lt;/TD></TR>");
            output.WriteLine("&lt;/TABLE>");
        }

        }


    }

 
normus.maximus
Asp.Net User
Re: Unable to add AJAX web parts2/5/2008 7:34:55 PM

0

 i've tried adding the code suggested in, and still get similar results.  maybe i should try asking this question this way...

 given that i've made the suggested changes to the web.config file, the default.master, and every AJAX enabled web part does not import successfully, would there be any other areas that could commonly be the source of prohibiting me from having AJAX enabled web parts added?

 

thanks again in advance,

norm
 

normus.maximus
Asp.Net User
Re: Unable to add AJAX web parts2/5/2008 7:38:31 PM

0

one last note for when i add these web parts...

 i generall place the web part .dll file into the GAC, and the .webpart file into the \wpcatalog folder.  i am under the assumption that this is the bare requirements of adding a webpart, but perhaps i'm wrong...
 

normus.maximus
Asp.Net User
Re: Unable to add AJAX web parts2/6/2008 3:22:17 PM

0

I believe I've figured out the problem and why it's been happening, although I'm not entirely sure as to why it's happening. 

 I've been doing the development locally and then bringing the files to the Sharepoint server.  When I do bring the files such as the assemblies to the server, I do it over the network...ie, \\servername\c$\windows\assembly.  I drop them in, give the server an iisreset, and expect them to work.

 
However, there are some permission problems, because if I remote into the server, and look in the GAC, the files I've just put in are NOT there.  So I then have to bring the files in while remoting into the server....

 It's a strange problem that doesn't make sense to me, but hopefully explaining this will save someone else some trouble.  Thanks again to everyone for the help!
 

8 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Programming ASP.NET AJAX Authors: Christian Wenz, Pages: 454, Published: 2007
AJAX, Rich Internet Applications, and Web Development for Programmers Authors: Harvey M. Deitel, Pages: 991, Published: 2008
Ajax: The Complete Reference Authors: Thomas A. Powell, Pages: 654, Published: 2008
The Silver Market Phenomenon: Business Opportunities in an Era of Demographic Change Authors: Florian Kohlbacher, Cornelius Herstatt, Pages: 505, Published: 2008
Head First Ajax Authors: Rebecca Riordan, Pages: 497, Published: 2008

Web:
Unable to add AJAX web parts - ASP.NET Forums However, I still get the following error when I attempt to add an ajax web part to a site: Unable to add selected web part(s). ...
What I Think About...: Ajax Web Parts Part 1 - Drag and Drop NET AJAX and Web Parts we will require more than the standard ASP. ... or you would see the Calendar component, but would be unable to change its position. ... To set the Web Part Manager's display mode, add the following code into the ...
AJAX Enabling ASP.NET 2.0 Web Parts with "Atlas" ... NET Ajax 1.0? After switching to Design Mode I am unable to drag/drop the web parts, and the Minimize/Close popup no longer appears (even after switching ...
Build web parts with AJAX Nov 15, 2006 ... Add the following directive at the top of your web part class… ... if you have more than once instance of your ajax web part on page both of ...
Overview: ASP.NET AJAX and Web Parts in Windows SharePoint ... NET AJAX and Web Parts in Windows SharePoint Services 3.0 ... NET AJAX when you add it to the Web page. You must add this as the first item in the page ...

Drag/drop from CatalogZone - ng.asp-net-forum ... how to interact between webpart and manage events in moss 2007 ? need a tutorial for behavioreditorpart · unable to add ajax web parts ...
ValidatorCalloutExtender inside UpdatePanel - asp.net_ajax.asp ... Web Parts controls. For more information, see ASP. ... /2007/01/25/links-to-asp- net-ajax-1-0-resources-and-answers-to-some-common-questions.aspx ... Add two ValidatorCalloutExtender control inside your Panel control. ...
Ajax Extension Setup - asp.net_ajax.asp ... NET AJAX 1.0 NET AJAX is a set of technologies to add AJAX (Asynchronous ... to create SharePoint 2007 Web Parts by using Web User Controls (ASCX files, ...
populating other controls when using Autocomplete - asp.net_ajax ... i cant see it in my add remove programs. All i have is the. MS AJAX.NET 2.0 AJAX Extensions 1.0. and the regular framework packages ... accordion webpart changing bottom accordions header ...
CodeVerge.Net Programming Forums New Control Gallery Additions Add one rich scheduling UI to any ASP. ... NET AJAX, try the ASP.NET Time Picker Control which resembles the Windows ... Introduction to Dynamic Data Web Application Model: Part II This article explains ... (4343), mailbox unavailable. the server response was: 5.7.1 unable to relay for ...






how to call multiview(view) from masterpage

menu with security

treeview menu

menu problem

asp.net 2.0 menu control css problem

changes to master page and style sheet not effected throughout project

printer friendly page using a querystring in masterpage and pagelayouts

my treeview webcontrols only works on my localhost and not on the website

stylesheets inside user controls: never clearly explained?

menu styles (gone after copying to server)

master pages for asp.net 1.0 (vb)

expand a tree view parent node when node text is selected

webresource.axd and authorization

pass control from masterpage to content page

treeview checkbox problems

navigateurl and target in a treeview

html encoding in the treenode.text property

master pages and themes on high traffic website

how to remove the arrow mark from the menu navigation control

pulling user name from loginname control to textbox

defaultbutton property with master page

treeview - how do i keep the state of a tree-view the same

setting property on inherited master page

submitting webform using master pages(asp.net 2.0)

extending site map

master pages and mobile web forms

help with maintainscrollpositiononpostback on a dedicated secure server ssl

issue with page navigation as i switch tabs

masterpage titlelabel isnt visible ?

two parts , right and left

   
  Privacy | Contact Us
All Times Are GMT