Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly is the point of the ScriptManager's EnablePartialRendering Attribute

Why would one want the EnablePartialRendering attribute to ever be "false" if building AJAX functionality into pages? Seems counter-productive. I've read here and there some things one may want to do with the attribute being false. But what I've read makes no sense.

Thoughts?

like image 672
TheHolyTerrah Avatar asked Feb 26 '09 16:02

TheHolyTerrah


People also ask

What is ScriptManager How will you use it?

ScriptManager control registers the script for the Microsoft AJAX Library with the page. This enables client script support features such as partial-page rendering and Web-service calls. You must use a ScriptManager control on a page to enable the following features of ASP.NET AJAX: 1.

What is a ScriptManager?

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.

Where do I put the ASP ScriptManager?

I would put the ScriptManager at the top of the Master page outside of any Multi-View. The ScriptManager is a what is used by the Microsoft controls to provide AJAX functionality.


2 Answers

I've used that attribute in testing before, to force a full "yellow screen" for server-side errors. Much easier to debug a quick server-side issue that way, than to inspect the error in the Event Log or the XmlHttpRequest's error response.

Also, one thing that it's not good for is preventing MicrosoftAjax.js from being injected. I've tried that in the past, hoping I could use the ScriptManager's script combining stand-alone. Unfortunately, no, it still injects MicrosoftAjax.js.

like image 166
Dave Ward Avatar answered Sep 18 '22 12:09

Dave Ward


Eilon Lipton made a note of this issue (and the SupportsPartialRendering property)in his blog. Of interest to note:

EnablePartialRendering is intended for the page developer. That is, the person who is building the ASP.NET page and placing the ScriptManager on it. They get to decide whether they're interested at all in using the partial rendering feature. For example, for optimization purposes they might disable the partial rendering feature entirely to prevent any extra script from being downloaded. Or perhaps to debug an issue they want to temporarily disable UpdatePanels from doing async postbacks.

like image 40
Dillie-O Avatar answered Sep 21 '22 12:09

Dillie-O