mobile browser detection and redirection

C

Carlos

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.
 
Joined
Aug 28, 2007
Messages
2
Reaction score
0
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
 
Joined
Aug 28, 2007
Messages
2
Reaction score
0
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
 
Joined
Aug 28, 2007
Messages
1
Reaction score
0
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>
**********************************************************
 
Joined
Aug 11, 2009
Messages
1
Reaction score
0
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:

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top