views:

677

answers:

3

Hi,

I am new to this whole sharepoint and aspx programming. I have developed a sharepoint web part that has a button control. The onclick event is mapped to a method in my web part code. When I click the button the whole page reloads and the web part is rendered again. Is there a way to prevent this reloading of the page? Is there a way to call the function method in the background? Something similar to AJAX.

Thanks, Jagannath

A: 

You can use Ajax, it just requires some sharepoint configuration. Here are a few posts to get you started:

Jason
A: 

Ajax or SilverLight are your only two options for Async operations without a page refresh.

webwires
A: 

Once you know the tricks needed to get SharePoint and ASP.NET AJAX to work together it's not that difficult.

Here are the steps required:

  1. Ensure the ASP.NET AJAX Extensions are installed on all the front-end web servers (this is not required if you are using .NET 3.5 as the Extensions are included in the Framework)
  2. Update the Web.config file for the SharePoint Application to support ASP.NET AJAX
  3. Ensure any page that is going to use AJAX has a ScriptManager
  4. Use an UpdatePanel or a client-side service call to get updated data and re-render the Web Part

This blog post has some resources from a talk I did on the subject at TechEd Barcelona 2008. These resources should give you the information you need to get started.

http://msmvps.com/blogs/windsor/archive/2008/11/13/teched-emea-resources-and-demos-integrating-asp-net-ajax-with-sharepoint-2007.aspx

Rob Windsor