Microsoft JScript runtime error: Sys.ArgumentException: An element with id ‘Form1’ could not be found.

I’ve been trying to add some Ajax to a Web Forms page.  It’s the first time I’ve used Ajax since dabbling with it when it was lauched.  I’ve had a problem:

“Microsoft JScript runtime error: Sys.ArgumentException: An element with id ‘Form1’ could not be found.
Parameter name: elementOrElementId”

I just found the solution here.  I had added a script using:

  <script src="Scripts/silverlight-detector.js" type="text/javascript" />

and when I changed it to:

  <script src="Scripts/silverlight-detector.js" type="text/javascript"></script>

it worked.  I know I’ll make this mistake again because I don’t like empty tags (uuuuuugly) and always write empty ones in the shortened form.  Since it was far from the first hit on the search, I’ve reproduced it here so I can find it again, quickly.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: