Im using MVC 3 asp.net
How can I add an item from ViewBag to html.TextBox like this:
@Html.TextBox("txtName",@ViewBag.Parameters.Name)
I tried this too:
@Html.TextBox("txtName","@(ViewBag.Parameters.Name)")
nothing seems to work.
any suggestions?
A View with just
works fine with me (notice the cast of the viewbag data to string because Extension methods cannot be dynamically dispatched.) also you will obviously have to change ViewBag.Title to your property