Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want verify JavaScript is enabled or not

If disabled so enable it

how to handle using asp.net By JavaScript

thanks in Advance
Posted

This should work
XML
<script type="text/javascript">
  document.write("<p>JavaScript is enabled.</p>");
  // whatever code you need to do with Javascript.
</script>

<noscript>
  JavaScript is not enabled or not supported.
  <!-- whatever markup you want to display if scripting is disabled/unavailable -->
</noscript>
 
Share this answer
 
v2
Comments
CRDave1988 22-Feb-12 7:46am    
my 5
At the end of the page,before add following code to detect javascript,
JavaScript
<noscript>
        <div class="n1">
        </div>
        <div class="n2">
            <center>
                Enable javascript in your browser to work in this site.
            </center>
        </div>
    </noscript>
 
Share this answer
 
Comments
CRDave1988 22-Feb-12 7:46am    
good
Both solution is right to know about java-script so no need to talk about that.

But in mater of enable that is not possible. u can just request or can guide how to enable JavaScript in their browser but u can not enable it by ur self through code.
 
Share this answer
 
C#
 HttpBrowserCapabilities browserCaps = Request.Browser;
if (browserCaps.EcmaScriptVersion.Major < 1)
{
//Javascript is not enabled on your browser.
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900