Is there any possibility to block (by attribute for example) passing URL's parameters into view?
public ActionResult UserForm(Guid? entityId, bool isCopy = false)
{
ViewBag.IsNewOrCopy = entityId.IsNullOrEmptyOrCopy();
if (ViewBag.IsNewOrCopy)
return View(new UserFormViewModel() {Roles= service.GetRoles(entityId, isCopy) });
return View(service.GetUser(entityId.Value));
}
For example I would like to stop passing entityId parameter because when I update changes via post method the entityId (@Html.HiddenFor(m => m.EntityId)
) is also passed via viewmodel although I would like it to be passed as null variable.