I want to create a mobile version of an existing desktop page. I made copy of my pages and used this code for detecting mobile device :
public void Page_Load(Object sender, EventArgs e)
{
if (Request.Browser["IsMobileDevice"] == "true" )
{
Response.Redirect(@"~/Content/PageXmobile.aspx");
}
else
{
Response.Redirect("PageX.aspx");
}
}
PageXmobile.aspx is a copy of PageX.aspx except that PageXmobile.aspx is formatted for mobile device but the content is the same on both pages. How to solve this duplication issue?