mobile browser detection and redirection

Discussion in 'ASP .Net' started by Carlos, Jan 19, 2005.

  1. Carlos

    Carlos Guest

    Hi all,

    I am currently able to detect the browser capabilities,
    and determine if a browser is from a mobile device.
    However, I only have been able to place this detection
    code in an aspx page. In other words, if I want the detection to take place
    in my home page, I do NOT know how to do it. i.e. www.myhome.com. However,
    I am able to do it at : www.myhome.com/browserdetection.aspx.
    I can mention www.davesipaq.com as example.
    Can anyone tell me how to make this happen?.

    Thanks,

    Carlos.
     
    Carlos, Jan 19, 2005
    #1
    1. Advertising

  2. Carlos

    ImRAGE

    Joined:
    Aug 28, 2007
    Messages:
    2
    How do you detect a mobile browser

    Please, tell me how to detect the mobile browser in any page.. Im making a site that can be both, pcs and mobiles. please, reply ASAP. i will try 2 get an answer for ur prob (i will b facin it in near future) n post it back to u. thnx
     
    ImRAGE, Aug 28, 2007
    #2
    1. Advertising

  3. Carlos

    ImRAGE

    Joined:
    Aug 28, 2007
    Messages:
    2
    hey carlos, here is your answer..

    im doing it on c#..

    protected void Page_Load(object sender, EventArgs e)
    {
    Boolean MobFlag = Request.Browser.IsMobileDevice();
    if (MobFlag) Server.Transfer("~/mobile/home.aspx");
    else Server.Transfer("~/login.aspx")
    }

    i think dis serves ur purpose.. if u check for mobile device in another way.. plz let me kno.. im interested to kno.. regards
     
    ImRAGE, Aug 28, 2007
    #3
  4. Carlos

    way11india

    Joined:
    Aug 28, 2007
    Messages:
    1
    Browser redirection

    Hi,
    you can use the following code
    but browser should have META REFRESH enable
    *************************************************
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="/css/winxp.blue.css"/>
    </head>
    <body><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
    <title>Welcome to BHI - Best Host India's Home Page</title>
    <meta http-equiv="refresh" content="1;URL=http://besthostindia.com">
    </head>
    <body>
    <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>Thanks for logging in</b>, you are now being taken to besthostindia.com</font><br><br>
    <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="http://besthostindia.com">click
    here</a> if you are not automatically forwarded</font></p></html>

    </body>
    </html></body>
    </html>
    **********************************************************
     
    way11india, Aug 28, 2007
    #4
  5. Carlos

    amimpat

    Joined:
    Aug 11, 2009
    Messages:
    1
    You can easily detect information of mobile device using
    http://51degrees.codeplex.com

    This Open source .NET mobile API gives detailed information of the mobile device making the request and also has the facility to redirect user automatically to mobile landing page when request in coming from mobile device.

    I have found this very useful and easy to implement in mobile website developments.

    Let me know if you face any issues in usage.

    Thanks
     
    Last edited: Feb 25, 2011
    amimpat, Aug 11, 2009
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phil Townsend

    browser detection for mobile devices

    Phil Townsend, Dec 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    737
    bruce barker
    Dec 2, 2004
  2. jaydev

    browser detection and redirection

    jaydev, Oct 23, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    442
    Mark Rae
    Oct 23, 2006
  3. jaydev
    Replies:
    41
    Views:
    1,490
    Chaddy2222
    Oct 27, 2006
  4. chen selina
    Replies:
    0
    Views:
    1,324
    chen selina
    Jul 13, 2010
  5. jaydev

    browser detection and redirection

    jaydev, Oct 23, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    121
    jaydev
    Oct 23, 2006
Loading...

Share This Page