Amazon.com Widgets RegisterStartUpScript not working

WilliaBlog.Net

I dream in code

About the author

Robert Williams is an internet application developer for the Salem Web Network.
E-mail me Send mail
Code Project Associate Logo
Ads by Lake Quincy Media

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.


RegisterStartUpScript not working

If, like me, you have just spent an hour or so trying to figure out why your simple alert box isn't popping up on page load after registering the script with Page.ClientScript.RegisterStartUpScript; you might find you are missing a form with a runat="server" tag on your page. It doesn't matter where it is, but it does have to be on the page somewhere, in order for the Javascript to be injected into the page. In the end I figured it out the hard way - close examination of pages where it worked vs pages where it didn't work.


Posted by Williarob on Wednesday, October 31, 2007 6:04 AM
Permalink | Comments (7) | Post RSSRSS comment feed

Comments

Ilana Israel | Reply

Sunday, February 17, 2008 2:09 AM

Ilana

Thank you Thank you Thank you!!!

Jon Trausti Iceland | Reply

Sunday, March 16, 2008 4:36 PM

Jon Trausti

Hi, thank you for the solution, saved me an hour! ;o)

onyee France | Reply

Monday, May 26, 2008 1:50 AM

onyee

Thank you ! It's a shame that microsoft creates such fonctions without even taking the time to explain correctly how it works ! Thank you once again !

Ian United States | Reply

Monday, June 16, 2008 6:21 AM

Ian

Thank you SO much for posting this.  I have been banging my head against the wall!

Manuel Mexico | Reply

Thursday, July 17, 2008 12:43 AM

Manuel

It really works. Thanks a bunch.

I had this problem with a single page, others are working fine. Actually the other pages does not require the form with runat=server attribute.
If anyone has a reference of what particular cases this is needed, it will be really helpful. I could not find an explanation.

Habeeb U.A.E. | Reply

Sunday, June 21, 2009 7:04 AM

Habeeb

Thanks a lot for the tip..... Helped me a lot...

Habeeb U.A.E. | Reply

Sunday, June 21, 2009 7:15 AM

Habeeb

Thanks a lot.

This a very good tip.

Mohammed Habeeb
http://www.habeebonline.com

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading