I have a website that I want to restrict only to Internet Explorer, how do I do that? Code is ASP.net
Printable View
I have a website that I want to restrict only to Internet Explorer, how do I do that? Code is ASP.net
Hi there,
Have you tried these?
Code:Dim browserName As String = Request.Browser.Browser
Dim browserVersion As String = Request.Browser.Version
Hi there,
Also, why do you want to restrict your application to Internet Explorer only?
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.Quote:
Because the master page doesn't line up right in other browsers and everyone has Internet Explorer, and it loads fine in IE
What do you mean?Quote:
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 postQuote:
No I haven't simply because that doesn't look like it's going to reject any other browser, will it?
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:Dim browserName As String = Request.Browser.Browser
Dim browserVersion As String = Request.Browser.Version
Code:If browserName = "IE" Then
'Do what you want here
Else
'Do what you want here
End If
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?
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.
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