Fieldset在MVC 4剃须刀中不起作用 [英] Fieldset not working in MVC 4 razor
本文介绍了Fieldset在MVC 4剃须刀中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我有以下代码用于fieldset但无法正常工作
Hi I have the following code for fieldset but is not working
<fieldset>
<legend>@Html.Label("Caller Information","Caller Information", new { @class = "normal-label" })</legend>
<table class ="align-center">
<tr>
<td>@Html.Label("First Name: ", new { @class = "normal-label" })</td>
<td>@Html.Label("Surname : ", new { @class = "normal-label" })</td>
<td>@Html.Label("Client : ", new { @class = "normal-label" })</td>
<td>@Html.Label("Contact No:", new { @class = "normal-label" })</td>
<td>@Html.Label("Alternative No:", new { @class = "normal-label" })</td>
</tr>
<tr >
<td>@Html.TextBoxFor(model => model.CallerFirstName, null, new {@class = "CallerFirstName" })</td>
<td>@Html.TextBoxFor(model => model.CallerSurname, null, new {@class = "CallerSurname" })</td>
<td>@Html.TextBoxFor(model => model.Client, null, new {@class = "Client" })</td>
<td>@Html.TextBoxFor(model => model.Contact_Number, null, new {@class = "Contact_Number" })</td>
<td>@Html.TextBoxFor(model => model.Alternative_Contact, null, new {@class = "Alternative_Contact" })</td>
</tr>
</table>
</fieldset>
推荐答案
尝试放置一个简单的文本值而不是@Html.Label .....
例如:
Try to place a simple text value instead of @Html.Label .....
example:
<fieldset>
<legend>Product Details</legend>
@Html.HiddenFor(model => model.DetailItem.ProductId)
<div class="editor-label">
@Html.LabelFor(model => model.DetailItem.Name)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.DetailItem.Name)
@Html.ValidationMessageFor(model => model.DetailItem.Name)
</div>
<p>
<input type="submit" value="Save" />
</p>
</fieldset>
这篇关于Fieldset在MVC 4剃须刀中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文