Hi there
I am very new to mvc
i got the below method in my controller class
public class Pv_AddressController : BaseController
{
public ActionResult GetAddress(string home, string postcode)
{
List< AddressModel> model = AddressUtility.FindAddressByPostcode(home, postcode,false);
return View(model);
}
public ActionResult AddressSelected (AddressModel addressSelected)
{
return View();
}
}
what i am after is to create a view for GetAdress
where it got a drop down list to display all the address.Tostring() (I have override the Tostring()Method to return a string format of the address)
and a @Html.ActionLink to AddressSelected Methord with the selected address to be passed as the parameter
what i have got so for is
@model List<Account_Portal.Models.AddressModel>
<div>
<h4>AddressModel</h4>
<hr />
<dl class="dl-horizontal">
<fieldset>
<select id="AddressList" name="AddressList">
<option value="0" selected="selected">Please Select Your Address</option>
@foreach (Account_Portal.Models.AddressModel add in Model)
{
<option value=add>add.Tostring()</option>
}
</select>
</fieldset>
</div>
<p>
@Html.ActionLink("Continue", "AddressSelected ", new { addressSelected = AddressList.Selected }) |
@Html.ActionLink("Back to List", "Index")
</p>