3

As you probably know, ASP.NET injects some javascript code to the form, like so:

<script type="text/javascript"> //<![CDATA[ var theForm = document.forms['aspnetForm']; if (!theForm) { theForm = document.aspnetForm; } function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } //]]> </script> 

Now, the problem with this is that if I turn Javascript off (using WebDev toolbar in FF), I get

"Browser does not support script" at the top of the page.

Does anyone know how I can set this tag, for this bit of auto-injected js?

Thanks Duncan

2
  • 1
    This is one of the many things about ASP.NET that has always aggravated me. Why can't it degrade with at least basic levels of grace?CommentedDec 29, 2009 at 13:48
  • ASP.NET degrades very nice, f.e. with validation stuff, updatepanels, and so on.CommentedDec 29, 2009 at 13:54

1 Answer 1

1

This is not a notification from asp.net. Are you sure there are no <noscript> blocks on your website?

Perhaps you are using some third party menu component?

4
  • I have other <script> elements which I add a <noscript> to (and keep blank). If I view the source, then there is a <noscript> block after the script I outlined above, but it has the default "Browser does not support script" put there by the browser.
    – Duncan
    CommentedDec 29, 2009 at 14:04
  • Can you provide a link to the affected webpage?CommentedDec 29, 2009 at 14:05
  • Thanks Jan, but it's in production at the moment so I can't! However if I view source, then I can see the above <script> block which has been put there by ASP.NET. Below this is the default <noscript> which has been added by the browser, because I can't set my own.
    – Duncan
    CommentedDec 29, 2009 at 14:16
  • The noscript is not added by ASP.NET, just remove every other javascript part until it doesn't show up :-)CommentedDec 29, 2009 at 15:03

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.