You can use ValueProvider.GetValue("HasEditPermission").RawValue
to access the value.
Controller:
public class BController : Controller
{
public ActionResult Index()
{
ViewBag.HasEditPermission = Boolean.Parse(
ValueProvider.GetValue("HasEditPermission").RawValue.ToString());
return PartialView();
}
}
View:
...
@if (ViewBag.HasEditPermission)
{
// some html rendering
}
...
Update:
Request.Params
gets a combined collection of QueryString, Form, Cookies, and ServerVariables items not RouteValues.
In
@Html.Action("Index", "BController", new { HasEditPermission = true })
HasEditPermission
is a RouteValue
.
you can also try something like this
ViewContext.RouteData.Values["HasEditPermission"]
in your View and subsequent child action views as well..