当前位置: 代码迷 >> .NET相关 >> mvc求
  详细解决方案

mvc求

热度:1077   发布时间:2013-02-26 00:00:00.0
mvc求高手指点
mvc 有没有办法实现提交表单和绑定列表在同一页面实现,下面是整个页面的代码
C# code
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Timepill.Models.ReplyModel>" %><asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">    Reply</asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"><% using (Html.BeginForm())   { %>    <form action="DiaryInput.aspx">     <br />    <table style="width:70%">      <tr>        <td>diarybook</td>      </tr>      <tr>        <td style="background-color: #EFEFEF">今天的日记</td>      </tr>      <tr>        <td>Time</td>      </tr>      <tr>        <td style="background-color: #EFEFEF"><%--        <%: diary.DiaryTime.ToString("HH:mm")%>--%>        </td>      </tr>    </table>    <br /><br />    <p>回复....</p>    <p><%= Html.TextAreaFor(m => m.ReplyContent, new { style = "width:400px;height:100px" })%>       <%= Html.ValidationMessageFor(m => m.ReplyContent)%></p>    <br /><br /><br /><br /><br />    <input class="btn-submit" type="submit" value="提交"  onclick="window.location='<%=Url.Action("Reply","Account")%>'"/></form><%} %>    <% foreach (var reply in Model)            { %>            <%if (reply.ReplyID != null)              {%>                <table style="width:70%">                  <tr >                      <td rowspan="3" style="width:60px"></td>                    <td><%: reply.DiaryTime%>|<%= Html.Encode(ViewData["UserName"])%>|回复</td>                  </tr>                  <tr><td style="background-color: #EFEFEF"><%: reply.DiaryContent%></td></tr>                            </table>              <%} %>                 <%else{ %>                      <div class="reply" style="background-color: #EFEFEF"></div>                     <%} %>       <% }%></asp:Content>

foreach那出现问题

------解决方案--------------------------------------------------------
探讨

回复了就有分啊,,结不了贴
  相关解决方案