I'm working on an ASP.Net webforms app, and I've run into a unique issue. There is a script manager for an update panel on the MasterPage, as well as a script manager in a sub-page calling the master page. This as i'm sure you will note cause an exception to be thrown and crash the webapp.
I've tried programatically excluding the scriptmanager + update panel from the code as follows:
<% If Not (Result.RawURL.Contains("ExcludedPageDirectory") Then %>
<!-- all that code goes here -->
<% End If%>
However I think just the presence of the script manager tag in the source is causing the error. How would I programatically handle this?
A page can contain only one ScriptManager control in its hierarchy. To register services and scripts for nested pages, user controls, or components when the parent page already has a ScriptManager control, use the ScriptManagerProxy control (Source: MSDN)