Search content within the blog

Wednesday, April 8, 2009

Redirecting to a page in the application if javascript is disabled

Sometimes the JavaScript may be disabled in the browser and your application may not perform or run in the desired way. so one of the ways to handle it will be to add the following lines in every page or best place is in the master page...

<meta http-equiv="REFRESH" content="0;URL=JavascriptDisabled.aspx" />

here noscript indicates if scripting function is disabled in the browser ....then we are redirecting to page called JavascriptDisabled.aspx .. the contents of that page are as follows....

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JavascriptDisabled.aspx.cs" Inherits="JavascriptDisabled" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" >
<head runat="server">
<title>Loobalee-Javascript Disabled</title>
<body bgcolor="Lightblue">
<form id="form1" runat="server">
<table style="top:750px" align="center" width="50%" border="1">
<td style="color:White">
Javascript is disabled in your browser .Enable revisit site after enabling <a href="Index.aspx">Click Here</a>

No comments:

Post a Comment