我在我的 Asp.net MVC Web 应用程序中有以下视图:-
p class="b"> <i class="icon-th"></i>Network Info :</p>
<div>
<span class="f">IP Address</span>
@Html.TextBoxFor(model => model.NetworkInfo.IPADDRESS)
@Html.ValidationMessageFor(model => model.NetworkInfo.IPADDRESS)
|
<input type="CheckBox" name="IsIPUnique" value="true" @(Html.Raw(Model.IsIPUnique ? "checked=\"checked\"" : ""))/> IP Unique.
</div>
<div >
<span class="f">MAC Address</span>
@Html.TextBoxFor(model => model.NetworkInfo.MACADDRESS)
@Html.ValidationMessageFor(model => model.NetworkInfo.MACADDRESS) |
<input type="CheckBox" name="IsMACUnique" value="true" @(Html.Raw(Model.IsMACUnique ? "checked=\"checked\"" : ""))/> MAC Unique.
</div>
<div >
<span class="f"> ILOIP</span>
@Html.EditorFor(model =>model.Server.ILOIP)
@Html.ValidationMessageFor(model =>model.Server.ILOIP)
</div>
</p>
<p = class="b"><i class="icon-th"></i>Server Status :</p>
<div>
<span class="f">Server Status </span>
@Html.DropDownListFor(model =>model.Server.StatusID, ((IEnumerable<TMS.Models.TechnologyStatu>)ViewBag.TechStatus).Select(option => new SelectListItem {
Text = (option == null ? "None" : option.Name),
Value = option.TechnologyStatusID.ToString(),
Selected = (Model != null) && (Model.Server != null) && (option.TechnologyStatusID == Model.Server.StatusID)
}), "Choose...")
@Html.ValidationMessageFor(model =>model.Server.StatusID)
</div>
<div>
<span class="f">Server Back Up Status</span>
@Html.DropDownListFor(model =>model.Server.BackUpStatusID, ((IEnumerable<TMS.Models.TechnologyBackUpStatu>)ViewBag.TechBackUpStatus).Select(option => new SelectListItem {
Text = (option == null ? "None" : option.Name),
Value = option.TechnologyBackUpStatusID.ToString(),
Selected = (Model != null) && (Model.Server != null) && (option.TechnologyBackUpStatusID == Model.Server.BackUpStatusID)
}), "Choose...")
@Html.ValidationMessageFor(model =>model.Server.BackUpStatusID)
</div>
我试图将每个节标题放在一个单独的<p>
中,但输出不是很友好。所以我可以采用哪种方法来分隔每个段落,以便用户可以更好地理解每个部分字段。在当前输出中,所有字段都将位于彼此之下,而每个部分之间没有空格?