1
How to pass information (product name) from my controller Products to my Products view index by Viewdata?
1
How to pass information (product name) from my controller Products to my Products view index by Viewdata?
1
In the controller
public class ProdutosController : Controller
{
public IActionResult Index()
{
ViewData["Informacao"] = "Alguma info";
return View();
}
}
In the view
<span>
<p>@ViewData["Informacao"]</p>
</span>
Browser other questions tagged c# asp.net-core
You are not signed in. Login or sign up in order to post.