0
I have this menu in _Layout.cshtml
@if (Response.Cookies["UserSession"]["UserRole"] == "Rh" || Response.Cookies["UserSession"]["UserRole"] == "Admin")
{
<li>
<a href="#"><i class="fa fa-bar-chart-o"></i> RH - Relatórios<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
@Html.ActionLink("Financiamento de veículos", "ExcelFinancing", "FinancingReport")
</li>
</ul>
</li>
}
The problem is that when calling this menu item, it should stop at the break inside the Action in the controller. This is the Action in the controller
[HttpGet]
public ActionResult ExcelFinancing(DateTime dateFinancing)
{
var t = 1 * 9;//Teste apenas, break aqui
return null;
}
What happens is that when I click on this Menu item, it gives me the error of type 500, Internal server error (handled by .net). How do I sign in to the controller by calling Menu?
NOTE: I have another view called View.cshtml that inherits from _Layout.cshtml and in it I have other functions. Should I do something from it? Or the call only in _Layout.cshtml would be sufficient?
Dude, I tested it here and apparently you’re right, the only thing I figured out that could be wrong is your controller’s name not to fall in there, it’s named Financingreportcontroller?
– Lucas Miranda
Mounting a link is not passing the "dateFinancing parameter"
– Ricardo Pontual
Take a test, try removing the "Datetime dateFinancing" parameter from your Action and see if it works.
– Bruno Soares
@Brunosoares, removed the parameter and now paused in break. If reply, I mark.
– pnet