我正在開發一個asp.net mvc 2應用程序,並使用Html.TextAreaFor來顯示一個textarea,用戶可以在其中輸入一個文本,然後根據需要存儲和發送該文本。Html.TextAreaFor在asp.net mvc 2渲染錯誤!
顯示此功能的視圖是強類型的(typeof(Message))。該消息具有發送者,接收者,主題和消息主體。在視圖中的代碼看起來像這樣 <% using (Html.BeginForm()) {%> <%: Html.ValidationSummary(true) %> <fieldset style="height:100%"> <legend>E-mail</legend> <div class="editor-label"> <%: Html.LabelFor(model => model.To) %> </div> <div class="editor-field"> <%: Html.TextBoxFor(model => model.To) %> <%: Html.ValidationMessageFor(model => model.To) %> </div> <div class="editor-label"> <%: Html.LabelFor(model => model.From) %> </div> <div class="editor-field"> <%: Html.TextBoxFor(model => model.From) %> <%: Html.ValidationMessageFor(model => model.From) %> </div> <div class="editor-label"> <%: Html.LabelFor(model => model.Subject) %> </div> <div class="editor-field"> <%: Html.TextBoxFor(model => model.Subject) %> <%: Html.ValidationMessageFor(model => model.Subject) %> </div> <div class="editor-label"> <%: Html.LabelFor(model => model.Message) %> </div> <div class="editor-field"> <%: Html.TextAreaFor(model => model.Message) %> <%: Html.ValidationMessageFor(model => model.Message) %> </div> <p> <input type="submit" value="SaveMail" /> </p> </fieldset> <% } %>
當我在瀏覽器中打開此頁面,然後提交按鈕放置在textarea上,我不能讓它呈現正確的...任何人的幫助?
聽起來更像我的HTML/CSS問題。你有鏈接到頁面? – 2010-11-09 12:50:10