Script manager equivalent... How can I do?

  • Thread starter Thread starter ThunderMusic
  • Start date Start date
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?
 
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
 
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)
 
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
 
Back
Top