i create a strongly type LocationViewData has a properties
...
public Location location { get; set; }
...
which is Location model (location.address, location.country ..etc)
in controller
public ActionResult Edit(int id)
{
...
LocationViewData ld = new LocationViewData();
...
return View(ld);
}
in view codebehind
public partial class Edit : ViewPage<MvcTest.Models.LocationViewData>
{
}
And my question is how i can auto get value from location properties in viewdata to display on textbox (ViewData.Model.location.address).
<%=Html.TextBox("address") %>
i don't want specify each field like this
<%=Html.TextBox("address", ViewData.Model.location.address) %>