我有一個asp.net mvc視圖,允許用戶在textarea中輸入一些描述。Html.TextAreaFor在asp.net mvc
我面臨兩個問題。
當我展開textarea時,它正在展開而不移動其他html元素,或者我無法創建Html.TextBoxFor()多行文本框。任何人都可以提出解決方案嗎?如果使用Textarea如何使其展開(增大尺寸),以便它不與其他元素重疊或如何將Html.TextBoxFor()用於多行?
這是我的代碼看起來像
<% using (Html.BeginForm())
{ %>
<%: Html.ValidationSummary(true)%>
<fieldset>
<div class="editor-label1">
<%: Html.LabelFor(Model => Model.PackageID)%>
</div>
<div class ="editor-field1">
<%: Html.HiddenFor(Model => Model.PackageID)%>
<%: Html.DisplayFor(Model => Model.PackageID)%>
<%: Html.ValidationMessageFor(Model => Model.PackageID)%>
</div>
<div class="editor-label1">
<%: Html.LabelFor(Model => Model.PackageName)%>
</div>
<div class ="editor-field1">
<%: Html.TextBoxFor(Model => Model.PackageName)%>
<%: Html.ValidationMessageFor(Model => Model.PackageName)%>
</div>
<div class="editor-label1">
<%: Html.LabelFor(Model => Model.PackageDesc)%>
</div>
<div class ="editor-field1" style= "padding-bottom: 50px; margin-bottom: 150px">
<%: Html.TextBoxFor(Model => Model.PackageDesc, new { TextMode = TextBoxMode.MultiLine, cols = "55", rows = "10" })%>
<%: Html.ValidationMessageFor(Model => Model.PackageDesc)%>
</div>
<div class="editor-label1">
<%: Html.LabelFor(Model => Model.PackageTitle)%>
</div>
<div class ="editor-field1">
<%: Html.TextBoxFor(Model => Model.PackageTitle)%>
<%: Html.ValidationMessageFor(Model => Model.PackageTitle)%>
</div>
<div class ="editor-label">
<%: Html.Label("Project ID") %>
</div>
<div class="editor-field">
<%:Html.DropDownList("ProjectID", (IEnumerable<SelectListItem>)ViewData["projects"])%>
</div>
<div>
<input type="submit" value="Save Edit" />
</div>
</fieldset>
<% } %>