开发者

Streaming content from (sharepoint) web part

开发者 https://www.devze.com 2022-12-23 13:36 出处:网络
How does one stream files, html or custom AJAX responses from web parts? Our current quick-and-very-dirty solution is to make the web part call the current page with certain query parameters, which

How does one stream files, html or custom AJAX responses from web parts?

Our current quick-and-very-dirty solution is to make the web part call the current page with certain query parameters, which the web part checks and instead of performin开发者_如何转开发g normal load it writes the required things to output and calls response end.

This sounds bad since SharePoint might load other web parts and execute their code before reaching our web part.

The web part is configured with data source settings which means the streaming context must be specific to the web part so it can acquire the correct data source settings.


My understanding is that you can pretty much do this in the same manners you would with a normal .Net website.

I have also used the mechanism you have described to provide a webpart JSON response feed per search "term" I provide as a param back to the current page. This is then picked up during the onload and then a switch is used to determine the correct response.

The other obvious means to doing this is to create supporting webservices which you can then register with the ScriptManager you have in your masterpage. Then you can simply configure your custom webpart to call the webservice method to draw the information required. It's usually a case of creating a business object layer with a webservice class for the business object that can be called reliably.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号