Пример #1
0
 public IActionResult Index()
 {
     //bool b = RequestExtensions.IsMobileBrowser(HttpContext.Request);
     if (RequestExtensions.IsMobileBrowser(HttpContext.Request))
     {
         return(Redirect("/Mobile"));
     }
     return(View());
 }
Пример #2
0
        /*
         * Checks if a user is on mobile before sending
         * them to the stocks page.
         *
         * If a mobile user is detected, it redirects them
         * to a mobile friendly page.
         */

        public ActionResult Stocks()
        {
            if (RequestExtensions.IsMobileBrowser(HttpContext.Request) == true)
            {
                return(View("Stocks.Mobile"));
            }
            else
            {
                return(View("Stocks"));
            }
        }
Пример #3
0
 public ActionResult Stocks(Items item)
 {
     if (ModelState.IsValid)
     {
         var url = this.Request.Path;
         return(RedirectToAction("SingleItem", "Items", item, url));
     }
     else
     {
         if (RequestExtensions.IsMobileBrowser(HttpContext.Request) == true)
         {
             return(View("Stocks.Mobile"));
         }
         else
         {
             return(View("Stocks"));
         }
     }
 }