Link to home
Start Free TrialLog in
Avatar of RBS
RBS

asked on

Filter out older IE Browsers Problem

Hi:

I have an online course and am trying to prevent people with older IE browsers from ordering it.  

I have the following:

<!--[if gt IE 8]>
                @Html.MenuLink("Order Courses", "OrderCourses", "Register")
  <![endif]-->

Open in new window


I find that all this does is make the Order Courses menu item invisible on IE 10 and IE11.

Any suggestions greatly appreciated.

RBS
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

'gt' means 'greater than'.  Try 'lt' which means 'less than'.
Avatar of RBS
RBS

ASKER

No, the gt is correct.  I have an earlier bit of code that shows the the following message if the browser is less than IE 9:

<!--[if lt IE 9]>
        <div class="lowBrowserMessage">
            <div class="ie-lowerthan9">HDCOElearning.com requires Internet Explorer 9 or greater</div>
<![endif]-->

Open in new window


This code works fine.  I guess the problem with using gt is that while IE browsers may recognize the rule, all others see this block of code as a comment and so ignore it.

My problem is that I want all browsers to see the Order link except those that are IE and below 9

RBS
That is correct.  Only IE will read either of those as a conditional directive.  All other browsers see it Only as a comment.
Avatar of RBS

ASKER

Can you suggest any way that I can make it so that any browser other than id browsers below  9 can see the Order Link?
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RBS

ASKER

I guess I will have to look at another method other than Conditional Comments - just wondering if you had any suggestions.
Nothing easy.  The standard javascript methods don't report the info you're looking for.  This site lists the "User-Agent" strings for many browsers: http://www.useragentstring.com/pages/useragentstring.php
Avatar of RBS

ASKER

Thanks Dave

RBS