Does it matter if I have one ScriptManager

Last post 07-05-2009 12:26 PM by sukumarraju. 6 replies.

Sort Posts:

  • Does it matter if I have one ScriptManager

    07-05-2009, 11:24 AM
    • Contributor
      2,709 point Contributor
    • Jackxxx
    • Member since 04-13-2003, 11:43 AM
    • Northern California
    • Posts 2,084

     We have a project that has had a scriptManager added to each page. We were thinking of switching to one scriptManager in our MasterPage. Is there any reason to do this, besided the obvious one scriptManager in one place?

    Thank you

    Jackxxx
  • Re: Does it matter if I have one ScriptManager

    07-05-2009, 11:32 AM
    • Participant
      989 point Participant
    • Scott927
    • Member since 09-20-2006, 4:53 AM
    • Phoenix, AZ
    • Posts 181

    As long as it's necessary on every page, the Master page is the logical place to put it. If there are a lot of pages that don't need it, you'll incur some overhead on those pages that is really unnecessary.

    You could also create two master pages in that scenario. One with a ScriptManager for the pages that need it and one without for those that don't.

    Scott M Schluer
    ---
    MCPD: ASP.NET Developer 3.5
  • Re: Does it matter if I have one ScriptManager

    07-05-2009, 11:33 AM
    • Contributor
      4,499 point Contributor
    • sukumarraju
    • Member since 06-14-2006, 10:01 PM
    • Scotland, UK
    • Posts 1,039

    Jackxxx:
    We have a project that has had a scriptManager added to each page. We were thinking of switching to one scriptManager in our MasterPage. Is there any reason to do this, besided the obvious one scriptManager in one place?
     

    Yes, it does matters. You need to have ScriptManager on each page wherever you are using Ajax controls throughout your application.

    I m not aware of an alternative way to set ScriptManger at project level.

    Let me know if you come to know.

    Thanks,

     

    -- "Mark As Answer" if my reply helped you --
    Recommended Book
    Application Architecture Guide 2.0
    My Blog
  • Re: Does it matter if I have one ScriptManager

    07-05-2009, 11:45 AM
    • Contributor
      2,709 point Contributor
    • Jackxxx
    • Member since 04-13-2003, 11:43 AM
    • Northern California
    • Posts 2,084

     My reason for asking is that I have read recently that if you put a scriptmanager in your masterpage you don't need them on any other page that accesses the masterpage.

    Thank you

    Jackxxx
  • Re: Does it matter if I have one ScriptManager

    07-05-2009, 11:56 AM
    • Participant
      989 point Participant
    • Scott927
    • Member since 09-20-2006, 4:53 AM
    • Phoenix, AZ
    • Posts 181

    This is correct.

    Scott M Schluer
    ---
    MCPD: ASP.NET Developer 3.5
  • Re: Does it matter if I have one ScriptManager

    07-05-2009, 12:17 PM
    • Contributor
      2,709 point Contributor
    • Jackxxx
    • Member since 04-13-2003, 11:43 AM
    • Northern California
    • Posts 2,084

     But you're saying there is a performance hit for the pages that don't need the scriptManager? This project has AJAX used in almost every page. So would it be better to remove the scriptManagers from the individual pages and only have the one in the MasterPage?

    Thank you

    Jackxxx
  • Re: Does it matter if I have one ScriptManager

    07-05-2009, 12:26 PM
    Answer
    • Contributor
      4,499 point Contributor
    • sukumarraju
    • Member since 06-14-2006, 10:01 PM
    • Scotland, UK
    • Posts 1,039

    Jackxxx:
    This project has AJAX used in almost every page. So would it be better to remove the scriptManagers from the individual pages and only have the one in the MasterPage?
     

    Absolutey. You can do that.

    As long as you are using Ajax control throughout your web app, it is better to keep ScriptManager in Master page, which is called on each and every page.

    I can't see any performance overhead in doing so.

     

    -- "Mark As Answer" if my reply helped you --
    Recommended Book
    Application Architecture Guide 2.0
    My Blog
Page 1 of 1 (7 items)