Register Script on WebControl

S

shapper

Hello,

I am working on a custom Asp.Net control.
This control needs to register a JQuery script:

$(document).ready(function(){
$("ul.nav").superfish();
});

My question is how and where should I register this script inside my
custom control class?
And should I register it through ScriptManager so it is "visible" to
Asp.Net Ajax?

Thanks,
Miguel
 
B

bruce barker

there is no need to use ScriptManager, as the ready event will not fire
from a async postback. just use standard:

ClientScriptManger.RegisterStartupScript();



-- bruce (sqlwork.com)
 
S

shapper

there is no need to use ScriptManager, as the ready event will not fire
from a async postback. just use standard:

ClientScriptManger.RegisterStartupScript();

-- bruce (sqlwork.com)

In which event should I register the script?
And how can I access that event in my custom control, which inherits
from Composite Control?

Thanks,
Miguel
 

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

Top