首页 新闻 会员 周边

mvc简单问题

0
悬赏园豆:20 [已关闭问题]

我的目的很简单:

在一个页面输入条件然后在同一页的下面把数据库中的记录显示出来!我给个代码

control代码为:

 [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Index(string Tcode)
        {
            var bookacc = _bookacc.Get_cc_bookAcc_subject(Tcode);
            return View(bookacc);
        }

index页面代码为:

<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcApplication1.Models.cc_bookAcc_subject>" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>选择科目代码:</h2>
    <%=Html.ValidationSummary("出错了,请检查!") %>
    <% using (Html.BeginForm()) { %>
    <fieldset style="text-align:center">
      <p>
       <label for="Tcode">科目代码:
         <%=Html.TextBox("Tcode")%>
         <%=Html.ValidationMessage("Tcode", "*")%>
       </label>
      </p>
      <p>
        <input type="submit" value="查询"/>
      </p>
    </fieldset>
    <% } %>
    <%=Model.TName %>//注意这里提示错误
   
    <p>
        To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
    </p>
</asp:Content>

以上代码不知道哪里出错了!

 

 

老鼠的主页 老鼠 | 初学一级 | 园豆:145
提问于:2009-10-22 17:22
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册