Script Manager

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I am including Javascript files in my page as follows:
Page.ClientScript.RegisterClientScriptInclude("MyScript",
"MyScript.js")

Can I do this through the ScriptManager?

And what is the difference?

Thanks,
Miguel
 
Yups,

ScriptManager.RegisterClientScriptInclude(Page, typeof(Page),
"MyScript",
Page.ResolveClientUrl("~/scripts/SomeJavascript.js"));

http://www.geekzilla.co.uk/View5E04A005-240D-40DD-A51D-9E3DEB62862E.htm

If you have defined your scriptManager in the master page and want to
reach it from your page or usercontrol use ScriptManagerProxy.

The thing is.... scriptManager it's placed in between the normal post life
cycle, so things like RegisterStartup script must be under
scriptManagerControl.

Good Luck
Braulio

/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top