Skip to content Skip to sidebar Skip to footer

Asp.net - Redirect If Javascript Is Not Enabled

I got this code in my Master page : Copy

If the browser has javascript enabled, the inner content is ignored... but if they don't the meta tag says, in 1 second, refresh this page... and the new URL is ...Javascript.Aspx

Solution 2:

The reason it is not set is because $("#<%=hfJavaScriptDetected.ClientID %>") is null. You need to wait for the page to load before you can set values.

What you want is:

$(document).ready(function() {
     $("#<%=hfJavaScriptDetected.ClientID %>").val('yes');
});

Post a Comment for "Asp.net - Redirect If Javascript Is Not Enabled"