Solved

Filter out older IE Browsers Problem

Posted on 2013-11-27
8
179 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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