本文介绍了部分视图回发未发布值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好 i得到了以下部分视图
Hello i have got the bellow partial view
@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>填写门牌号后,邮政编码点击了继续actionLink,我也是GetAddress方法但是 主页,邮政编码为空。 我错过了什么 贝娄是我的GetAddress行动方法
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
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
推荐答案使用此行public ActionResult GetAddress([FromUri ] string home,[FromUri] string postcode) use this line public ActionResult GetAddress([FromUri]string home,[FromUri] string postcode)
使用JAVASCRITP提交来自 USING JAVASCRITP TO submit the from
更多推荐
部分视图回发未发布值
发布评论