我認爲這是一個命名空間的問題,答案很可能是死的簡單,但我在這個MVC的東西是新的。MVC的新手問題關於強類型的瀏覽
我有多個意見命名爲「指數」。這不是一個問題,直到我試圖創建一個名爲新,強類型的視圖「索引」。
(爲了什麼它的價值,我想用的NerdDinner樣品中要遵循的步驟一起,但在VB而不是C#)
當我將命名爲強類型的視圖「指數」編譯器拋出這個錯誤:
Base class 'System.Web.Mvc.ViewPage(Of System.Collections.Generic.List(Of Models.User))' specified for class 'Index' cannot be different from the base class 'System.Web.Mvc.ViewPage' of one of its other partial types.
有人可以告訴我爲什麼發生這種情況,並且我能做些什麼來緩解這一問題?
在此先感謝。
VIEW:
<%@ Page Title="" Language="VB" MasterPageFile="~/Views/Shared/Site.Master"
AutoEventWireup="false" CodeBehind="Index.aspx.vb"
Inherits="SampleSite.Index" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
</asp:Content>
代碼背後:
Imports System.Web.Mvc
Imports System.Collections.Generic
Partial Public Class Index Inherits System.Web.Mvc.ViewPage(Of List(Of SampleSite.Models.User))
End Class
郵政`Index`查看,請 – 2009-07-17 18:51:54