gpt4 book ai didi

c# - MVC 4 - Html.Partial() 在 DIV 中显示 System.Namespace 文本(出现在页面上的 html 中)

转载 作者:行者123 更新时间:2023-11-30 22:20:08 25 4
gpt4 key购买 nike

<分区>

在我的 MVC 4 项目中,我在我的 _Layout.chshtml 页面中呈现局部 View 。它在下拉菜单中:

<div class="dropdown-menu" id="dropdown-login>
@Html.Partial("~/Views/Account/_LoginPartial.cshtml")
</div>

当我运行我的应用程序并单击下拉菜单时,会发生这种情况:

enter image description here

我有其他局部渲染,但这种事情不会发生。有人知道为什么会这样吗?

局部 View

    @model LetLord.Models.LoginModel

@(Html.BeginForm("Login", "Account", FormMethod.Post))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)

@Html.LabelFor(m => m.UserName)
@Html.TextBoxFor(m => m.UserName)
@Html.ValidationMessageFor(m => m.UserName)

@Html.LabelFor(m => m.Password)
@Html.PasswordFor(m => m.Password)
@Html.ValidationMessageFor(m => m.Password)


@*@Html.CheckBoxFor(m => m.RememberMe)
@Html.LabelFor(m => m.RememberMe, new { @class = "checkbox" })*@

<input type="submit" value="Log in" class="btn btn-primary btn-block" />
<p>
@Html.ActionLink("Register", "Register", "Account", routeValues: null,
htmlAttributes: new { id = "registerLink" }) if you don't have an account. </p>

}


@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com