[RESOLVED]How to use ScriptManager in master page when content pages already have ScriptManager?

The content pages in my project have ScriptManager control but the Master Page does not have. I now want to use UpdatePanel in the master page but it is not permitting to put another ScriptManager.

I cannot change to ScriptManagerProxy in content pages as the change needs to be replicated to around fifty pages.

Is there any way to use UpdatePanel in Master Page by either sharing content page’s ScriptManager or something else?

From MSDN:

"Any ASP.NET page that includes an UpdatePanel control also requires a ScriptManager control. To use UpdatePanel controls with master pages, you can put a ScriptManager control on the master page. In this scenario, the master page provides a ScriptManager control
for every content page. If you do not want partial-page updates enabled for individual content pages, you can disable partial-page updates for those pages.

Alternatively, you can put the ScriptManager control on each content page. You might do this if only some of the content pages will contain UpdatePanel controls."

…so you can’t have the ScriptManager on both the content an master page.

Place scriptmanager in master page, remove scriptmanager in all pages.

Any ASP.NET page that includes an UpdatePanel control also requires a
ScriptManager control. To use
UpdatePanel controls with master pages, you can put a
ScriptManager control on the master page. In this scenario, the master page provides a
ScriptManager control for every content page. If you do not want partial-page updates enabled for individual content pages, you can disable partial-page
updates for those pages.

http://msdn.microsoft.com/en-us/library/bb398864(v=vs.100).aspx

<div class="subsection">

A Web page can contain only one ScriptManager control, either directly on the page or indirectly inside a nested or parent component. The
ScriptManagerProxy control lets you add scripts and services to content pages and to user controls if the master page or host page already contains a
ScriptManager control.

When you use the ScriptManagerProxy control, you can add to the script and service collections defined by the
ScriptManager control. If you do not want to include specific scripts and services on every page that includes a particular
ScriptManager control, you can remove them from the
ScriptManager control. You can then add them to individual pages by using the
ScriptManagerProxy control instead.

</div>

Hii,

Put your script manager in master page.

Remove from all other webforms.

in one page only script manger is there.not more then once.

Using script manager in webforms is not good practice.

Put it in master page so you don’t have put again.

Leave a Reply