MVC Archive

If we want to call action of same controller with parameters then from view the we use @Html.ActionLink("LinkText","ActionName","ControllerName",new{id = idValue}) e.g. @Html.ActionLink("Edit","Edit","Home",new{id = 3}) then link generated will be “http:localhost/Home/Edit/3” If we use same structure for calling action from...
Recently While working in my application I wanted to store custom data in FormsAuthenticationTicket. After doing some googling I found bellow method to store custom data in FormsAuthenticationTicket. string userData = JsonConvert.SerializeObject(lUser); // this is my user data, "lUser"...
Authorization Filters: This filter is used to check whether request coming to use action or controller is authorized to use that action or controller or not. Usually it is used to authorize users who requests to controller or actions....
It has 10 types of result. 1. ActionResult : It is a base class for all other types of results. 2. ViewResult : Renders specific view to response result. public ActionResult Myview() { return View(“MyView”); } 3. PartialViewResult :...