Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can ASP.NET AJAX partial rendering work inside a SharePoint 2007 application page?

I have a simple page with my ScriptManager and my UpdatePanel, and my ContentTemplate has one ListBox and one Label. I am just trying to catch its OnSelectionChanged so I can update the text in the Label. No matter what settings I try to tweak, I always get a full-page postback.

Is this really not going to work, or am I just screwing this up?

like image 265
Chris Farmer Avatar asked Aug 06 '08 04:08

Chris Farmer


People also ask

What is partial page rendering?

Partial-page rendering removes the need for the whole page to be refreshed as the result of a postback. Instead, only individual regions of the page that have changed are updated. As a result, users do not see the whole page reload with every postback, which makes user interaction with the Web page more seamless.

What is use of ScriptManager in ASP net?

ScriptManager is a server-side control that sits on your Web Form and enables the core of ASP.NET AJAX. Its primary role is the arbitration of all other ASP.NET AJAX controls on the Web Form and the addition of the right scripting libraries to the Web browser so that the client portion of ASP.NET AJAX can function.

What is partial postback?

Partial postback is a technique where you dont post the whole data to the action page and thus the current page is not changed/removed.This is implemented using ajax where only a limited data is posted back like.


2 Answers

You need to have Sharepoint 2007 service pack 1 -- or else there's no chance. (Sharepoint 2007 predates ajax 1.0 -- they built some support into service pack 1)

Next, from a trouble shooting point of view, test that the exact same code functions as expected when hosted in a regular asp.net page. (Literally copy and paste your code across into a fresh page, to rule out any typographical errors). Ruling sharepoint in or out of the problem area will help narrow down the solution space.

like image 97
Leon Bambrick Avatar answered Nov 16 '22 06:11

Leon Bambrick


If you have installed SharePoint 2007 (without Service Pack 1) then you can follow an example like the following article:

AjaxBasePart: Easy ASP.NET 2.0 AJAX Extensions 1.0 and Office SharePoint Server 2007

The reason for this is that there exists a specific problem with mixing doPostback, UpdatePanel and SharePoint -- and the symptom is exactly what you're seeing: a full-page postback instead of an asynchronous postback. See this KB article for a workaround: A Web Part that contains an ASP.NET AJAX 1.0 UpdatePanel control that uses the _doPostBack() ...

Otherwise you can just install Service Pack 1 to fix your problem:

Windows SharePoint Services 3.0 Service Pack 1 (SP1)

like image 23
user9841 Avatar answered Nov 16 '22 06:11

user9841