Click here to Skip to main content
15,886,833 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,i have an application which runs only on IE <= 8.I dont know how this application is coded to manage this situation.How to find the code and how it will be and how to change the mode to work in all browsers?

Thanks in Advance.
Posted

You can make use of coditional comments and javascript to do that.
Something like following should work-
HTML
<!doctype html>
<!--[if (gt IE 8)|!(IE)]> <html class="not_supported"> <![endif]-->
<!--[if (lt IE 8)|(IE 8)]><!--> <html class=""> <!--<![endif]-->
<head>

Javascript:
JavaScript
(function ($) {
    "use strict";

    if ($('html').is('not_supported')) {
        alert("This browser version is not supported");
        window.location.href = 'http://www.google.com';
    }
}(jQuery));


Hope, it helps :)
Let me know if it doesn't work.

Reference:
http://stackoverflow.com/a/10965091/1006297[^]
 
Share this answer
 
v3
Comments
Maniraj.M 20-Nov-15 7:29am    
Thank you it worked!
you can do this way .

C#
private float getInternetExplorerVersion()
{
  // Returns the version of Internet Explorer or a -1
  // (indicating the use of another browser).
  float rv = -1;
  System.Web.HttpBrowserCapabilities browser = Request.Browser;
  if (browser.Browser == "IE")
    rv = (float)(browser.MajorVersion + browser.MinorVersion);
  return rv;
}

private void Page_Load(object sender, System.EventArgs e)
{
  string msg;
  double ver = getInternetExplorerVersion();
  if (ver > 0.0)
  {
    if (ver >= 8.0) 
      msg = "You're using a recent version of Internet Explorer.";
    else
      msg = "You should upgrade your  Internet Explorer.";
  } 
  else
    msg = "You're not allowed other browser.";

  Label1.Text = msg;
}
 
Share this answer
 
Comments
Maniraj.M 20-Nov-15 7:30am    
Thank you it worked!

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