|
-
Jun 8th, 2010, 09:45 PM
#1
Thread Starter
Lively Member
How to check browser version
I have a website that I want to restrict only to Internet Explorer, how do I do that? Code is ASP.net
-
Jun 8th, 2010, 09:57 PM
#2
Addicted Member
Re: How to check browser version
Hi there,
Have you tried these?
Code:
Dim browserName As String = Request.Browser.Browser
Dim browserVersion As String = Request.Browser.Version
-
Jun 8th, 2010, 09:58 PM
#3
Addicted Member
Re: How to check browser version
Hi there,
Also, why do you want to restrict your application to Internet Explorer only?
-
Jun 9th, 2010, 12:08 AM
#4
Thread Starter
Lively Member
Re: How to check browser version
Because the master page doesn't line up right in other browsers and everyone has Internet Explorer, and it loads fine in IE
-
Jun 9th, 2010, 12:09 AM
#5
Thread Starter
Lively Member
Re: How to check browser version
 Originally Posted by Claude2005
Hi there,
Have you tried these?
Code:
Dim browserName As String = Request.Browser.Browser
Dim browserVersion As String = Request.Browser.Version
No I haven't simply because that doesn't look like it's going to reject any other browser, will it?
-
Jun 9th, 2010, 12:50 AM
#6
Addicted Member
Re: How to check browser version
Because the master page doesn't line up right in other browsers and everyone has Internet Explorer, and it loads fine in IE
I don't have that kind of problem with master pages, maybe you're not coding or doing it in a correct way, since Internet Explorer is the only browser that displays it correctly. I suggest you visit www.w3schools.com so you can look up on how to code your web pages correctly so that all major browsers can display your pages correctly.
No I haven't simply because that doesn't look like it's going to reject any other browser, will it?
What do you mean?
Last edited by Claude2005; Jun 9th, 2010 at 12:52 AM.
Reason: typo
-
Jun 9th, 2010, 12:59 AM
#7
Addicted Member
Re: How to check browser version
No I haven't simply because that doesn't look like it's going to reject any other browser, will it?
After reading it again, here's the code again on my first post
Code:
Dim browserName As String = Request.Browser.Browser
Dim browserVersion As String = Request.Browser.Version
To answer your question, it's a no. I just gave you this in order for you to have a head start. You could just tell me if you don't know what to do with that code. So here's some addition to the code above...
Code:
If browserName = "IE" Then
'Do what you want here
Else
'Do what you want here
End If
-
Jun 9th, 2010, 01:45 AM
#8
Thread Starter
Lively Member
Re: How to check browser version
I hate to be a pain, but how do I display a Message or even just a webpage (I am used to VB.net where I would say Page1.show, but that doesn't work in ASP.net) to the user if they're not using Internet Explorer?
-
Jun 9th, 2010, 01:55 AM
#9
Addicted Member
Re: How to check browser version
Hi there,
Hmm, do you know HTML? It's a good start to learn HTML first before going to ASP.NET. You could do HTML on the aspx pages to display static information.
-
Jun 9th, 2010, 02:01 AM
#10
Re: How to check browser version
Hey,
Ok, you are going about this in completely the wrong way (in my opinion).
So your master page doesn't line up correctly in other browsers, how about you fix that problem, rather than preventing users from seeing your site if they are not using IE. You would be cutting traffic to your site greatly if you do this.
Although I have IE installed, for testing purposes, I use Chrome as my default browser, and I wouldn't want to have to open IE just to see a site that only works in IE, and I am sure I am not alone in this.
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|