Exemple #1
0
        // GET: Movies
        public ActionResult Random()
        {
            var movie = new Movie()
            {
                Id = 1, Name = "Skrek!"
            };
            var customers = new List <Customer>
            {
                new Customer {
                    Name = "Customer 1"
                },
                new Customer {
                    Name = "Customer 2"
                }
            };

            var viewModel = new RamdomMovieViewModel()
            {
                Movie     = movie,
                Customers = customers
            };



            return(View(viewModel));

            //return Content("Hello saqib");
            //return HttpNotFound("Resource not found");
            //return new EmptyResult();

            //return RedirectToAction("Index", "Home", new { page = 1, sortBy = "name" });

            //return RedirectToRoute(new { page = 1, sortBy = "name" });
        }
        public ActionResult Random()
        {
            var movie = new Movie()
            {
                Name = "Baahubali"
            };
            var customers = new List <Customer> {
                new Customer {
                    ID = 1, Name = "Vijay"
                },
                new Customer {
                    ID = 2, Name = "Kumar"
                }
            };
            var viewModel = new RamdomMovieViewModel()
            {
                Movie     = movie,
                Customers = customers
            };
            List <string> Movies = new List <string>();

            Movies.Add("Darling");
            Movies.Add("Mirchi");
            Movies.Add("Chatrapathi");
            Movies.Add("Munna");
            ViewData["Movies"] = Movies;
            ViewBag.Movies     = Movies;
            TempData["Movies"] = Movies;
            return(View(viewModel));
            //return Content("Hello World");
            //return HttpNotFoundResult();
            //return new EmptyResult();
            //return RedirectToAction("Index", "Home", new { page = 1, sortBy = "name" });
        }