If user disable the javascript in browser, most site will not view normally, you can pompt user this and
show user a page to guide user how to enable the javascript in different browser.
1. Add noscript in root frame page or master page or every page.
<noscript>
<meta http-equiv="refresh" content="0;url=<%= Url.Action( "NoJS", ConstantString.PagesKey, new {target = Request.Url} ) %>" />
</noscript>
Note: You must transfer the current request url to the nojs page so as to direct back since this type of
redirect, it can not get the reffer url in code, the reffer url wil be null.
2. Add a new page NoJS.aspx to guide user how to enable js in different browser and return previous url,
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
<title>Javascript Disabled </title>
<style type="text/css">
body {
background-color: #f1f8fe;
font-size: 12px;
color: #564b47;
padding: 20px;
margin: 0px;
text-align: center;
}
#content {
text-align: left;
vertical-align: middle;
margin: 10px auto;
padding: 10px;
width: 550px;
background-color: #ffffff;
border: 1px dashed #A1D0EC;
}
.active
{
color:#EB6C20 !important;
text-decoration:underline;
}
</style>
</head>
<body>
<div id="content">
<p>
In order to view pages normally you must have javascript enabled on
your web-browser. To enable javscript please follow these instructions, then click
the link below to be sent back to the previous page.</p>
<p>
<strong>Internet Explorer 7 or 8</strong>
<ol>
<li>Click the Tools menu.</li>
<li>Select Internet Options.</li>
<li>Click the Security tab.</li>
<li>Click the Custom Level button.</li>
<li>Scroll down until you see the 'Scripting' section. Select the 'Enable' radio button
for 'Active Scripting.'</li>
<li>Click the OK button.</li>
<li>Click the Yes button in the confirmation window.</li>
</ol>
</p>
<p>
<strong>Firefox 3 </strong>
<ol>
<li>Click the Tools menu.</li>
<li>Select Options.</li>
<li>Click the Contents tab.</li>
<li>Select the 'Enable JavaScript' checkbox.</li>
<li>Click the OK button.</li>
</ol>
<p>
<strong>Safari 3</strong>
<ol>
<li>Click the Safari menu.</li>
<li>Select Preferences.</li>
<li>Click the Security tab.</li>
<li>Select the 'Enable JavaScript' checkbox.</li>
</ol>
</p>
<p>
<a class="active" href="<%= (Request["target"] != null) ? Request["target"].ToString() : ConfigUtility.GetConfigString(ConstantString.HomeUrlConfigKey) %>" id="backPage">Back to Previous Page</a></p>
</div>
</body>
</html>
it will redirect back when user enable the javascript according to the guidence.