How do I call a view passing a parameter?
Type, if parametro = 1 <h1>Teste1</h1> else <h1>Teste2</h1>
How do I call a view passing a parameter?
Type, if parametro = 1 <h1>Teste1</h1> else <h1>Teste2</h1>
By answering the question: How to send 2 Controller objects to the View in C # ASP.NET MVC? , do the following
In your controller :
public ActionResult View()
{
ViewBag.Parametro = 1;
return View();
}
And in your View:
@if (((int)ViewBag.Parametro) == 1) {
<h1>Teste1</h1>
} else {
<h1>Teste2</h1>
}