Unregistering startup script

  • Thread starter Thread starter KBSTours
  • Start date Start date
K

KBSTours

Hi,

I am using
Page.ClientScript.RegisterStartupScript

but couldn't find any way to unregister the registered script.

Is there a way to do that?
 
Hello Michael,

I've actually read that.

In my case, I have several user controls which are trying to register the
same/similar startup scripts (basically windows.onload = function
windowsLoadEvent()
{
do something here;
}

As you see all may have different purposes to run something on
windows.onload but as you know the last one written is the winner. So what I
want to do is th to keep the requests added to Page.Items and each time my
base function is called (all those user controls inherit from it) if it is
registered it will unregister and iterate from Page.Items to add all of them
together to the onload in 1 go.

Now as this is the case , I don't know when the last one will be called and
for many reasons I really do not want to do anything on the page level in
the prerender etc. (I am using a portal application and I don't want to
alter it as newever version will override the old one and I will forgot
that)..


Soo, I need to unregister. Isn't there really a way?
 

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