Click here to Skip to main content
15,913,685 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
i have got the bellow partial view
C#
@model AccountPortal.Models.AddressModel

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        <h4>AddressModel</h4>
        <hr />
        <p>
            @Html.Label("House Number or Name")
            @Html.EditorFor(model => model.AddressLine1)
        </p>
       <p>
           @Html.LabelFor(model => model.Postcode)
           @Html.EditorFor(model => model.Postcode)
       </p>
   
    </div>
}

<div>
    @Html.ActionLink("Continue", "GetAddress", new { home = Model.AddressLine1, postcode =Model.Postcode })
    @Html.ActionLink("Don't Know the Postcode", "AddressManuallyEnter")|
    @Html.ActionLink("BFPO Customer", "ManuallyAddForBFPO")
</div>

and after filling the House Number, and the postcode clicked on the Continue actionLink which too me to GetAddress method but

the home, postcode are null.

what i have been missing out

bellow is my GetAddress Action method
C#
public ActionResult GetAddress(string home, string postcode)
        {
            var A = SelectedAddress;
          List< AddressModel> model = AddressUtility.FindAddressByPostcode(home, postcode, false);
          AddressUtility.BuildAddressSelectList(ref model);
          
          return PartialView(model);
        }

Appreciate all your help
Posted

use this line public ActionResult GetAddress([FromUri]string home,[FromUri] string postcode)
 
Share this answer
 
USING JAVASCRITP TO submit the from
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900