I need to send some values from controller to shared view to show in the top of
[HttpPost]
[Route("login")]
public async Task<ActionResult> Login(LogInRequest logInRequest)
{
IEnumerable<UserClaim> UserClaims = null;
User user = null;
if (ModelState.IsValid)
{
user = await GetUserByEmailAndPassword(logInRequest.UserName, logInRequest.Password);
if (user.Id != 0)
{
showMenu = await ShowLoanMenu(logInRequest);
if (showMenu)
{
******** I need to send showMenu and user.Name to shared view
return RedirectToAction(Constants.Views.SearchView, Constants.Views.LoanDriverController);
}
}
.....
return View(logInRequest);
}
I don't want to use TempData, viewdata, viewbag or session, how I can send it by querystring or adding to model.
This is one of the layout:
<ul>
<li class="logo">
<img src="~/Content/Images/logo.png" alt="" />
</li>
<li class="nav-item">
*** @if(showmenu is true)
{
<ul>
@Html.ActionLink("Loan Driver", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
</ul>
}
</li>
</ul>
and this is another layout:
<div class="header">
<div class="master-container">
<div class="heading">Garage</div>
<div class="primary-nav">
<ul>
<li>******show name of the person</li>
<li>@Html.ActionLink("Logout", "logout", "Home")</li>
</ul>
</div>
</div>