I am getting null value for the actor(which is an action parameter). I tried all possible ways to call the action method. I don't know if there is any setting in the web.config or what. When I try it in sample MVC application, it worked fine(getting parameters as expected). But the same thing is not working in my current working project. Please help me.
Html:
<table>
<tr>
<th>Time Info</th>
<th>Actor</th>
<th>Reset</th>
</tr>
@{
List<LockedUser> lockedUsers = ViewBag.LockedUsers;
foreach (LockedUser lockedUser in lockedUsers)
{
<tr>
<td>@lockedUser.TimeInfo</td>
<td>@lockedUser.Actor</td>
<td>@Html.ActionLink("Reset", "Reset", "Admin", new { actor = "John" }, null)</td></tr>
}
}
</table>
Action in AdminController:
public ActionResult Reset(string actor)
{
if (System.Web.HttpContext.Current.Cache.Get(actor) != null)
{
System.Web.HttpContext.Current.Cache.Remove(actor);
Debug.WriteLine("Reset Successfull");
ViewBag.Message = "Reset Successfull";
}
else
{
ViewBag.Message = "Unable to reset";
}
return View();
}
RouteConfig:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{WCP}",
defaults: new { controller = "EmailConfirm", action = "Index", WCP = UrlParameter.Optional }
);