new to razor, I have a label and a button
<form action="" method="post" enctype="multipart/form-data">
<label name="Mylabel">Test + @ViewData["MyLabelUpdate"]</label>
<input type="submit" id="MyBtn" Value="Change Label">
Now in the controller I have:
[HttpPost]
public ActionResult Index()
{
return RedirectToAction("Index");
}
How do I get the label to change using the actionresult method? Thanks
You have to make your controller look like this:
And, your view: