I would use nested master pages. The main wizard, which has markup with an additional holder for the content place where the script manager will be. Then two versions of the nested wizard, one with the script manager and one without it. And your pages use the corresponding nested homepage.
I leave the text below, so the comments make sense, but this does not work ...
How about this:
-Please add the application to your web interface with a list of URIs that you do not want to have a script manager.
-In the page_init event handler of the wizard, get this collection and test to see if the current page request is in the list. If so, remove the scriptmanager from the wizard's control collection.
those. in the code of the main page:
Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init If DirectCast(Page, System.Web.UI.Page).AppRelativeVirtualPath = "~/Test.aspx" Then Me.Controls.Remove(Me.FindControl("ScriptManager1")) End If End Sub
Note. There is a great danger in what you do. If there are any update panels on the main page or on any of the pages on which you delete the manager, they will bomb. You can scroll through the master collection of the wizard and the page in the main file of the wizard and check all the update panels. Although, I'm not sure what you would do if you found them. Removing them will likely result in the removal of any content in them. In the best case, you can either 1) not delete the script Manager if the update panel is found, or 2) Configure an error.
source share