Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 582337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:40:33+00:00 2026-05-13T14:40:33+00:00

How to check whether the browser supports javascript? I need to redirect the users

  • 0

How to check whether the browser supports javascript?

I need to redirect the users to a Notification Page, if the user’s browser don’t support javascript. How can i do this in my asp.net mvc(C#) application?

Whats the best way to handle this in asp.net mvc?

The html i tested:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <title>Stack Overflow</title>
    <link rel="stylesheet" href="http://sstatic.net/so/all.css?v=6230">
</head>
<body>
    <noscript>
        <div id="noscript-warning">Stack Overflow works best with JavaScript enabled<img src="http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif" alt="" class="dno"></div>
    </noscript>        
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:40:34+00:00Added an answer on May 13, 2026 at 2:40 pm

    Wow at all the -1. Erm, well… it may not be valid, but the meta-in-noscript hack (as everyone’s already posted and been voted down for) really is the only way to do what you want. But:

    I need to redirect the users to a Notification Page, if the user’s browser don’t support javascript

    I think what you want isn’t what you need. No-JS redirection is horrible for usability/accessibility. Please don’t do that.

    Consider an approach like SO’s instead: keep the user on the same page, but just include an on-page notification that scripting is unavailable:

    <noscript>
        <div id="noscript-warning">Stack Overflow works best with JavaScript enabled</div>
    </noscript>
    

    You can use CSS to make this big and red and appear on top of the whole of the rest of the page if you have to.

    You can be more specific too. Often you need not only JavaScript, but support for certain scripting features that aren’t available everywhere. For example IEMobile (pre-8) does have JavaScript, but has stunted DOM support which stops you running most modern scripts. Or you might be relying on HTML5-related interfaces that aren’t everywhere yet. In that case you can sniff client-side and set the notification’s visibility manually:

    <head>
        <style type="text/javascript">
            #scriptwarning {
                position: absolute; z-index: 9;
                top: 25%; left: 25%; width:50%; height: 50%;
                color: red; background: white;
                border: dashed red 1px;
            }
            body.jsok #scriptwarning { display: none; }
        </style>
    </head><body>
        <script type="text/javascript">
            // Sniff capabilities in whatever way is necessary
            //
            if ('featureWeWantToUse' in window) {
                document.body.className= 'jsok';
            }
        </script>
        <div id="scriptwarning">
            JavaScript is disabled, or too rubbish on your browser to do what we want.
            See the <a href="browsersupport.html">supported browsers</a> page for more information.
        </div>
    </body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 371k
  • Answers 371k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Visit history is merely a collection of visits in the… May 14, 2026 at 7:02 pm
  • Editorial Team
    Editorial Team added an answer You need to use the selectAnnotation message on MKMapView: -… May 14, 2026 at 7:02 pm
  • Editorial Team
    Editorial Team added an answer Anticipate and invest in change. Many businesses seem to think… May 14, 2026 at 7:02 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.