DBPOLLDemo.Controllers.QuestionController.Index C# (CSharp) Method

Index() public method

Returns a view listing all the questions associated with a poll.
public Index ( int id, String name ) : System.Web.Mvc.ActionResult
id int
name String
return System.Web.Mvc.ActionResult
        public ActionResult Index(int id, String name)
        {
            if (Session["uid"] == null || Session["uid"].ToString().Equals(""))
            {
                return RedirectToAction("Index", "Home");
            }
            if ((int)Session["user_type"] < User_Type.POLL_MASTER)
            {
                return RedirectToAction("Invalid", "Home");
            }

            ViewData["name"] = name;
            ViewData["id"] = id;
            pollid = id;

            return View(new questionModel().displayQuestions(id));
        }