Getting up and running?

Topics: User Forum
Jul 7, 2009 at 8:13 PM

Hi,

I downloaded the latest source code, compiled it and tried to deploy the two solutions (config first and SharePoint Ajax as second). The first thing i had to do was to add -allowgacdeployment to "SharePoint.AJAX.deploy.cmd", it seems like the project needs to deploy assemblies to the GAC (although I get the impression that it also deploys to the local bin folder?). The features looks ok in teh 12 HIVE and the js files are deployed to the folder "layouts/SHarePoint.Ajax"

I can add the XML web part but I don´t get past the animated loading gif, I have changed the "XML Path" to a RSS feed from a list in the same site.

What else can I check to get the web part to display?

Regards,

// Henrik

Coordinator
Jul 7, 2009 at 9:16 PM

Hey Henrick!

Thanks for trying this out. Once you get it running, I believe you'll love it. The error you're seeing is that scriptresource.axd, which serves the Microsoft AJAX runtime, is not registered as a handler.

Try applying the web application feature that the config project installs. That should write the web.config modification that you need. Note that you do need the 3.5 SP1 .net framework installed.

Otherwise, you can just enter the following httpHandler entry manualy (or through code). In my current production code I no longer use this config project, just the main project, and I register the web.config modification in my own code.

 <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />

>> although I get the impression that it also deploys to the local bin folder?).

.PDB files (debug symbols) are installed in the bin folder, and SafeControls in the web.config. I did move to GAC deployment to support client code activation in feature receivers.

Jul 8, 2009 at 7:31 AM

Hi Daniel,

Adding the verb attribute was the thing missing. Althought I didn´t have the web application feature in Central Admin, so something was missing there.

So now the ajax webpart works as expected but is there any more code samples to look at? I wonder how to hook up client-side events on a textbox (input element) to call code deployed on the server?

Thanks for the fast response on my first question.

Regards,

// Henrik

Coordinator
Jul 8, 2009 at 2:37 PM

Henrik,

The main point of the library is the XmlComponent, which is wrapped in the XmlWebPart.

To use this web part, specify an XML url and an XSLT url. Sample URLs are provided in the XmlWebPart. You can set a refresh interval if you like, so the web part refreshes live data every so often.

You can inhert from this class to build your own custom web parts to programatically set the xml and xslt urls and add javascript, or you can just configure them in the part. The "main" development effort is building XML endpoints (http handlers work nicely in sharepoint 2007) and then simple XSLT to render it.

 >> I wonder how to hook up client-side events on a textbox (input element) to call code deployed on the server?

If you rendered inputs in XSLT, you would use JavaScript to wire up events that call your (JavaScript) class library, which would call into ajax-enabled web services (asmx/wcf/simmle web handlers).

The library focuses on this simple principle: load data on the client, and render data on the client. From there, you can add to it for your own needs. The AjaxWebPArt is just a VERY slim base class-- the real base class you want to use for this will be the XmlWebPart.

 

Jul 10, 2009 at 6:17 AM

Hi,

Thanks for the info. I´ll do some more testing later and post back if there are more questions ( most certainly it will be :) )

 

// Henrik