2PTTechnology

The platform that enables you to build rich, interactive communities
Welcome to 2PTTechnology Sign in | Join | Help
in Search

detect a mobile browser

Last post 11-03-2008, 9:14 PM by admin. 0 replies.
Sort Posts: Previous Next
  •  11-03-2008, 9:14 PM 193

    detect a mobile browser

    // Declare a boolean variable for mobile browser
    bool IsMobi = false;

    // If request header can find the X-Wap-Profile, than it is a mobile browser

            if (Request.Headers["X-Wap-Profile"] != null)
            {
                if (Request.Headers["X-Wap-Profile"].ToString().Length > 0)
                {
                    IsMobi = true;
                    Response.Redirect("index.aspx", true);       
                }
                Else
                {
                    Response.Redirect("web/index.aspx", true);
                }   
            }  

View as RSS news feed in XML
Powered by Community Server (Personal Edition), by Telligent Systems