how to make application browser dependent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • adarshyam
    New Member
    • Oct 2008
    • 31

    how to make application browser dependent

    hey guys,
    i have developed a web application using vb.net and hosted to server since my application has buttons that work only on internet explorer i wanted to show an error when the users open the website on anyother browsers.. can anybody pls help me how to do that..
  • nukefusion
    Recognized Expert New Member
    • Mar 2008
    • 221

    #2
    One way would be to use the HttpBrowserCapa bilities class. It has a Browser property which should contain information on the browser being used.

    Be aware that some browsers have the ability to fake the UserAgent string and lie about which browser they are. You would be better of if possible modifying your code to work with all browsers or providing alternative methods for non-IE users, of which there are many.

    Comment

    • Curtis Rutland
      Recognized Expert Specialist
      • Apr 2008
      • 3264

      #3
      You can get the user agent string with this:
      Code:
      Request.ServerVariables("HTTP_USER_AGENT")
      Also, I'm moving this thread to the ASP.NET forum.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        You can also use the Request.Browser Object to discover information about the client's web browser.

        Comment

        Working...