Solved

Filter out older IE Browsers Problem

Posted on 2013-11-27
8
175 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 82

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 82

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
 

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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 82

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 82

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now