Answered get the Browser details

  • Tuesday, August 05, 2008 5:32 AM
     
     

    How do we read the details of the browser that is used to display silverlight object.?

    like browser type, version etc...

All Replies

  • Tuesday, August 05, 2008 5:38 AM
     
     

    hi,

    you will get all kind of Browserinfo from here

    HtmlPage.BrowserInformation;

  • Tuesday, August 05, 2008 5:43 AM
     
     Answered

     

    You can get those details with the help of  HtmlPage.BrowserInformation.

    For e.g If You Want to Get Browser Name write                    

    string str=    HtmlPage.BrowserInformation.Name;

    string browserVersion=

    HtmlPage.BrowserInformation.BrowserVersion;

    Mark this as answer if this answers your Question.

  • Tuesday, August 05, 2008 5:45 AM
     
     Answered

     add reference to System.Windows.Browser;

    so that you will get a object HtmlPage.BrowserInformation in which you will get all the details like browser name, version, platform used etc.. 

  • Tuesday, August 05, 2008 5:47 AM
     
     

    Can I get the client IP also?

  • Tuesday, August 05, 2008 5:52 AM
     
     
  • Tuesday, August 05, 2008 6:01 AM
     
     Answered

     You willnot be able to get  the IP address from the silverlight object. You need to get that from the Request  object from the web application, which can be then sent to the silverlight object using initparms..

    This will get you the IP 

    HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]

     

    In the aspx page load event, you will be able to pass the initparms like this

    Silverlight1.InitParameters = "IPAddress=" + HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

  • Tuesday, August 05, 2008 6:10 AM
     
     

    u can use:   System.Windows.Browser.HtmlPage.BrowserInformation.BrowserVersion

     

  • Monday, October 31, 2011 6:15 AM
     
     

    Hi

    i am try both the method

    1 get client browser infor on SilverlightHostPage.aspx =>

    string ClientBrowser = Request.Browser.Browser.ToString() + " "+ Request.Browser.Version.ToString();

     

    2   System.Windows.Browser.HtmlPage.BrowserInformation.BrowserVersion in silverlightpage code behind

     

    My current browser version in IE 9.012 

    but both way i get IE version 7 

    How i get client machine browser info

    thanks in advance