Scripts not working when Scriptmanager Control is in place

Last post 06-30-2009 11:49 PM by Vince Xu - MSFT. 1 replies.

Sort Posts:

  • Scripts not working when Scriptmanager Control is in place

    06-28-2009, 7:47 PM
    • Member
      point Member
    • frankinstien
    • Member since 06-28-2009, 11:42 PM
    • Posts 5

     Hello,


    I have a custom control that dynamically creates controls, when I place the scriptmanager control on the page the custom control scripts for the dynamically created controls will not work. The scripts do load but when the controls try to access them I get script errors such as Sys. or C1. not defined or No instance of an Object exists.

    However if no sciptmanager control is in place those controls that do not require a scriptmanager work fine when I register the scripts manually.


    Any thoughts,


    thanks in advance...


    Frank

  • Re: Scripts not working when Scriptmanager Control is in place

    06-30-2009, 11:49 PM
    Answer

     Hi,

    What about your javascript? ScriptManager just will render some script on the client. Please put your code after "form" tag and don't forget type ";" for each line of code.

    In general, if we want to build a custom control with Ajax, we had better make use of ScriptControl or ExtenderControl to build it. So we need make the ajax control derives from ScriptControl or ExtenderControl class, instead of webcontrol. That will be better in this way to build an ajax control.


    Vince Xu
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (2 items)