All that was needed was one fuction (method) and a simple if statement:
private bool CheckHeaders( string forThis ) { bool found = false; foreach ( string s in Request.Headers ) if ( s.Contains( forThis ) ) { found = true; break; } return found; } public ActionResult Index( string memberName ) { if ( Request.Browser.IsMobileDevice || CheckHeaders( "iPhone" ) ) return Redirect( string.Format( "~/Mobile/Index/{1}", memberName ) );// rest of this mehtod isn't being shown.}
No comments:
Post a Comment