I have a dropdown list that is populated on a content page like this
<%: Html.DropDownListFor(x => x.SelectedName, Model.NameList) %>
<input name="btnGo" type="submit" value="GO" />
When the user selects the name and click the GO button, I have an HTTP Action that gives me the name
[HttpPost]
public ActionResult SelectName(string SelectedName)
{
...
}
Now I want to take that name and set a lable on the master with the SelectedName
in MVC2 how is this accomplished?
Remember, this is not Web Forms. 🙂
In other words, you can’t do this in the Controller action:
Your best bet would be to put the text you want in the ViewData:
And then set the Label to that in your Master View: