Saturday, March 24, 2012

Mobile and full-size browser in the same project

Hi All,
Did somebody do a combination of Mobile Web Forms and Usual Web Forms in one
project? How can we detect the user's browser and switch between two
different login forms? My application suppose to work on PDA as well as on
PC. And I need to switch in the beginning, maybe even before login, between
these different forms. How can I do that?
1. I need to detect which browser is using on a user's side.
2. Redirect to a required page. But Mobile and Usual size are using a
different redirect command. What about that? Or it's better to create a few
separate projects, start a main standalone project, detect the browser, then
call a required web project using a predefined URL?
Regards,
Dmitri.The Time tracker starter kit does have Mobile forms and a following check...
.
public void Page_Load(Object sender, EventArgs e) {
if (Request.Browser["IsMobileDevice"] == "true" ) {
Response.Redirect("/TTMobileCSVS/TimeSheet.aspx");
}
else {
Response.Redirect("TimeEntry.aspx");
}
}
Depending on the requesting browser it changes the page.
You can check more at www.asp.net - Starter Kits tab.
Thanks,
Tap

0 comments:

Post a Comment