這是一個奇怪的...我已經使用Razor視圖引擎ASP.Net MVC 3 RC視圖下面的標記Asp.Net MVC 3剃刀渲染Bug?
<p>
<div class="editor-label">
@Html.LabelFor(model => model.Client.FirstName)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Client.FirstName) @Html.ValidationMessageFor(model => model.Client.FirstName)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Client.LastName)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Client.LastName) @Html.ValidationMessageFor(model => model.Client.LastName)
</div>
</p>
的問題是,當它呈現時,P標籤是不是周圍的DIV !它是這樣呈現的:
<p>
</p><div class="editor-label">
<label for="Client.FirstName">First Name</label>
</div>
<div class="editor-field">
<input class="text-box single-line" data-val="true" data-val-required="The First Name field is required." id="Client_FirstName" name="Client.FirstName" value="My FName" type="text"> <span class="field-validation-valid" data-valmsg-for="Client.FirstName" data-valmsg-replace="true"></span>
</div>
<div class="editor-label">
<label for="Client.LastName">Last Name</label>
</div>
<div class="editor-field">
<input class="text-box single-line" data-val="true" data-val-required="The Last Name field is required." id="Client_LastName" name="Client.LastName" value="My LName" type="text"> <span class="field-validation-valid" data-valmsg-for="Client.LastName" data-valmsg-replace="true"></span>
</div>
這是怎麼回事?任何幫助表示讚賞!
你有鏈接,出現這種情況?我只是在我的頁面上扔了相同的代碼(allthough以不同的形式),它工作得很好。 – Paul 2010-12-06 05:46:12