Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Firefox
I want my site to open in IE only.Can it choose the browser on its own???
Posted 3-Jun-12 20:44pm
sofia3727
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Yes: Hvae a look at the HttpRequest.Browser property[^]
 
Be aware though, that you will severely limit your market / audience if you do that. If you look at the browser statistics[^] you will see that 60% of users will not be able to use your site...
  Permalink  
Comments
Peter_in_2780 at 5-Jun-12 19:56pm
   
With due respect, I don't see how you can avoid user agent spoofing as mentioned in my answer below. It appears to me that the .Browser property is .NET's predigested User-Agent (or am I missing something huge here?)
 
Cheers,
Peter
OriginalGriff at 6-Jun-12 3:10am
   
You can use browser spoofing to pretend you are something other than you are, but most users don't know how to.
I wanted to say that it is a silly idea to restrict your site to a single browser (presumably because the OP can't be bothered to test in other browsers). It annoys me when sites only work in IE - my wife has to do computer training on a site that just doesn't work in Chrome and it's a PITA to remember she needs IE to open it.
Peter_in_2780 at 6-Jun-12 3:25am
   
I totally agree. M$ in particular has a bunch of stuff that just fails in mysterious ways if you use FF or Chrome.
My original reply was meant to point out that forcing a particular browser is impossible. And, as you pointed out, pointless.
 
Cheers,
Peter
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Short answer: NO.
Your code can examine the User-Agent header in the HTTP request and make some decisions based on the content, but that is not foolproof by any means. The HTTP requester (browser, spider, wGet, etc, etc) can build a User-Agent header containing whatever it wants, ans as an HTTP responder, your site has to take it on trust. Google or check Wikipedia[^] for "User Agent Spoofing"
 
Peter
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,569
1 Sergey Alexandrovich Kryukov 6,168
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 4 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100