Solved

Filter out older IE Browsers Problem

Posted on 2013-11-27
8
178 Views
Last Modified: 2013-11-28
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
Comment
Question by:RBS
  • 4
  • 4
8 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39682706
'gt' means 'greater than'.  Try 'lt' which means 'less than'.
0
 

Author Comment

by:RBS
ID: 39683996
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
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39684009
That is correct.  Only IE will read either of those as a conditional directive.  All other browsers see it Only as a comment.
0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 

Author Comment

by:RBS
ID: 39684110
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
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39684135
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
 

Author Comment

by:RBS
ID: 39684182
I guess I will have to look at another method other than Conditional Comments - just wondering if you had any suggestions.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39684193
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
 

Author Comment

by:RBS
ID: 39684199
Thanks Dave

RBS
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question