Script manager equivalent... How can I do?

T

ThunderMusic

Hi,
I know there is something called (something like) Script Manager in asp.net
AJAX... What is the best way of achieving the kind of behavior it has? I
mean, maybe I didn't understand it correctly, but as I understand it, many
(if not all) asp.net AJAX control gets the Script manager (in the Head of
the page) and send the script is must have in the page header... I want to
achieve the same... what is the best way?
 
T

ThunderMusic

oups, sorry, I sent it inadvertadly... ;) so, as I was saying, What is the
best way to achieve this?

1) Put it in the head, then in my controls, get the page and go through all
the controls to find the script manager, then keep a reference to it for
future use?
2) Create a web control that will also be a singleton (is it possible)
3) any other ideas?

thanks

ThunderMusic
 
T

Teemu Keiski

Hi,

why not using something that's already done? E.g use the ScriptManager
itself.

In your control you can use System.Web.UI.ScriptManager.GetCurrent
(shared/static method taking the Page in) to get the ASP.NET Ajax
ScriptManager on the Page (method returns null if it doesn't exist)
 
T

ThunderMusic

just because we're not using asp.net Ajax for our site... ;) I used this
example because I looked at asp.net ajax briefly in the past months, but
we're not planning on using it right now... but you answered my question
anyway, asp.net ajax script manager is used by getting a reference using a
static method... that's what I wanted to know...

Thanks a lot

ThunderMusic
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top