1
I have the following situation, in my _Layout I am checking:
@{
var controller = HttpContext.Current.Request.RequestContext.RouteData.Values["Controller"].ToString();
var view = HttpContext.Current.Request.RequestContext.RouteData.Values["action"].ToString();
}
I send this information to the controller so that after changing the language of the page I can return to it.
<a href="@Url.Action("AlteraIdioma", "Home" , new{LinguagemAbreviada="pt", NomeControler = @controller, NomeView= @view })" >
<img src="~/ContentAdmin/dist/img/brasil-160x160.png" id="pt" class="user-image" alt="brasil">
<span class="hidden-xs">-</span>
</a>
I want to know how I can get the "Id" if you have.
It wouldn’t be easier to get the full url?
– Tiedt Tech
can try using viewBag
– Eduardo Sampaio
@Eduardosampaio, I needed an example, thank you
– Harry