[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

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
0
RBS
Asked:
RBS
  • 4
  • 4
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
'gt' means 'greater than'.  Try 'lt' which means 'less than'.
0
 
RBSAuthor Commented:
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
0
 
Dave BaldwinFixer of ProblemsCommented:
That is correct.  Only IE will read either of those as a conditional directive.  All other browsers see it Only as a comment.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
RBSAuthor Commented:
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?
0
 
Dave BaldwinFixer of ProblemsCommented:
I'm not sure what you mean.  "Conditional comments" have been dropped as of IE10 so they are no longer useful.  http://msdn.microsoft.com/en-us/library/ie/hh801214%28v=vs.85%29.aspx
0
 
RBSAuthor Commented:
I guess I will have to look at another method other than Conditional Comments - just wondering if you had any suggestions.
0
 
Dave BaldwinFixer of ProblemsCommented:
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
0
 
RBSAuthor Commented:
Thanks Dave

RBS
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now