views:

62

answers:

1

Hello

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

+1  A: 

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?

Jan Jongboom
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
Can you provide a link to the affected webpage?
Jan Jongboom
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
The noscript is not added by ASP.NET, just remove every other javascript part until it doesn't show up :-)
Jan Jongboom