【发布时间】:2017-06-19 13:16:39
【问题描述】:
我无法绑定下拉值。也许我在我的代码中遗漏了一些东西。在这里我附上我的视图代码。
<tr>
<td>
<div class="form-group" style="margin-bottom:0px;">
@Html.DropDownList("ProofId", ViewBag.Idproofs as SelectList, new { @class = "form-control", id = "ProofType2", name = "ProofType2" })
</div>
</td>
<td>
<div class="form-group" style="margin-bottom:0px;">
@Html.TextBoxFor(x => x.EvidenceData[1].ProofNumber, new { @class = "form-control", id = "IdNumber2", name = "IdNumber2" })
</div>
</td>
<td>
<div class="form-group" style="margin-bottom:0px;">
@Html.TextBoxFor(x => x.EvidenceData[1].ProofImage, new { @class = "form-control", id = "ProofPic2", type = "file", name = "ProofPic2" })
<a href="~/images/ProofPics/@Model.EvidenceData[1].ProofImage" download title="Download Image" style="text-decoration:underline;"><i class="fa fa-download" aria-hidden="true"></i> Download Image</a>
</div>
</td>
</tr>
这是我的控制器代码:
public ActionResult EditProfile(string country)
{
if (!User.Identity.IsAuthenticated)
return new RedirectResult(Utility.Config("RedirectPath"));
var idprooflist = AccountManager.LoadProoftypes(country ?? "United States");
ViewBag.Idproofs = new SelectList(idprooflist, "ProofId", "ProofName");
UserRegistration UserProfileData = ProviderManagerBLL.GetProviderDetails(Convert.ToInt32(Session["UserID"].ToString()));
return View(UserProfileData);
}
【问题讨论】:
-
您的问题是什么?你不能在POST上找到它?还是什么?
-
我无法绑定下拉值
标签: javascript c# asp.net-mvc