protected void Page_Load(object sender, EventArgs e)
{
    if (Session["JSChecked"] == null)    //JSChecked -indicates if it tried to run the javascript version
    {
        Session["JSChecked"] = "Checked";    // prevent infinite loop
        string path = Request.Url + "?JScript=1";
        Page.ClientScript.RegisterStartupScript(this.GetType(), "redirect", "window.location.href='" + path + "';", true);
    }
    if (Request.QueryString["JScript"] == null)
        Response.Write("JavaScript is not enabled - goto http://www.java.com for free download.");
    else
        Response.Write("JavaScript is enabled.");
} 

