我如何在MVC 5中使用Html帮助程序中的Class或Id,我已经尝试过这个但它对我不起作用

时间:2017-09-07 13:09:57

标签: css asp.net-mvc razor

在课堂上使用Html Helper,但它对我的代码不起作用。

@using (Html.BeginForm())
            {
                <p class="form-title">YOUR NAME <span>(required)</span></p>
                @Html.TextBoxFor(model => model.Name, new { @class = "normal-box"})
                <p class="form-title">YOUR EMAIL <span>(required)</span></p>
                @Html.TextBoxFor(model => model.Email, new { @class = "normal-box" })
                <p class="form-title">SUBJECT</p>
                @Html.TextBoxFor(model => model.Subject, new { @class = "normal-box" })
                <p class="form-title">YOUR MESSEGE</p>
                @Html.TextAreaFor(model => model.Messege, new { @class = "messege-box" })

                <input type="submit" value="SUBMIT"/>
            }

0 个答案:

没有答案