0
我已经开发使用Telerik rad控件的小型Asp.net MVC3应用程序,因为我尝试获取数据列表以创建强类型视图控件,它是创建所有的控件,我运行应用程序它显示错误,如对象引用null异常 在我的数据库中我有10条记录,那么为什么它shoeing的错误,请帮助我...在这里,我已经发布我的代码请参阅此一旦。如何使用TelerikExtension控件创建Asp.net Mvc3应用程序
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TelerikMvcApplication1.Models.tb1_post>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>Index</h2>
<fieldset>
<legend>tb1_post</legend>
<div class="display-label">post</div>
<div class="display-field"><%: Model.post %></div>
<div class="display-label">postdate</div>
<div class="display-field"><%: String.Format("{0:g}", Model.postdate) %></div>
<div class="display-label">username</div>
<div class="display-field"><%:Model.username %></div>
</fieldset>
<p>
<%: Html.ActionLink("Edit", "Edit", new { id=Model.postid }) %> |
<%: Html.ActionLink("Back to List", "Index") %>
</p>
</asp:Content>
你可以发布堆栈跟踪并告诉我错误在哪一行吗? –
嗨,谢谢你给出的答案,它显示在<%:Model.post%>这里在正常的MVC我得到的解决方案的错误。我只是在该视图页面(索引)创建控件添加viewcontrol,我选择强键入... – Victor