2011-01-28 2 views
1

찾을 수 없습니다이 내가MVC2 쪽수를 매기다 문제, 참조

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<FYP_MVC_SDP_Assignment.Helpers.PaginatedList<Member>>" %> 

생각에서 여기 그것은 회원

의 인덱스에있는 NerdDinner

에서 내 페이지를 매기 코드 참조
<% if (Model.HasPreviousPage) { %> 
    <%: Html.RouteLink("<<<", 
         "Member", 
         new {Page=Model.pageindex -1}) %> 
<% } %> 
<% if(Model.HasNextPage) { %> 
<%: Html.RouteLink(">>>", 
       "Member", 
       new {Page =Model.PageIndex +1})%> 
<% } %> 

동안 그쪽으로 큰 문제가 오는 곳이다

이 헬퍼는 (.../Helpers/PaginateList.cs)에 있습니다.

이것은이 내 경로

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.Mvc; 
using System.Web.Routing; 

namespace FYP_MVC_SDP_Assignment 
{ 
// Note: For instructions on enabling IIS6 or IIS7 classic mode, 
// visit http://go.microsoft.com/?LinkId=9394801 

public class MvcApplication : System.Web.HttpApplication 
{ 
    public static void RegisterRoutes(RouteCollection routes) 
    { 
     routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 

     routes.MapRoute(
      "Member", 
      "Member/page/{page}", 
      new {controller = "Member", action ="Index"} 
     ); 

     routes.MapRoute(
      "Default", // Route name 
      "{controller}/{action}/{id}", // URL with parameters 
      new { controller = "Home", action = "Index", id = UrlParameter.Optional }   // Parameter defaults 
     );                         

    } 

    protected void Application_Start() 
    { 
     AreaRegistration.RegisterAllAreas(); 

     RegisterRoutes(RouteTable.Routes); 
    } 
} 

}이 동안

입니다

 public ActionResult Index(int page=0) 
    { 
     const int pageSize = 8; 
     var members = clubmemberrepository.FindAllMember(); 
     var paginatedMember = new PaginatedList<tblMember> (members, 
      page, 
      pageSize); 
     return View(paginatedMember); 
    } 

내 회원 인덱스 컨트롤러가

10

} }는 내가 점점 시도 계속 오류입니다 stackoverflow에서 솔루션을 통해하지만 여전히 unsolveable ... 누구든지 thi에서 나를 도울 수 의 난

Server Error in '/' Application. 

Compilation Error 

Description: An error occurred during the compilation of a resource required to service  this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0234: The type or namespace name 'Helpers' does not exist in the namespace 'FYP_MVC_SDP_Assignment' (are you missing an assembly reference?) 

Source Error: 


Line 170:  
Line 171: [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()] 
Line 172: public class views_member_index_aspx : System.Web.Mvc.ViewPage<FYP_MVC_SDP_Assignment.Helpers.PaginatedList<Member>>, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler { 
Line 173:   
Line 174:  private static bool @__initialized; 

Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\eeab298d\fa291c0d\App_Web_index.aspx.7979c542.cpekphek.0.cs Line: 172 

도메인 주소이 오류를 액세스 = http://localhost:8219/Member

답변

1

PaginatedListFYP_MVC_SDP_Assignment.Controllers namesoace에있을 apears (비록 .... 할당 XD

오류에 대해 서두를 필요가있는 동안 거기에 속하지 않는다). 그리고 뷰에 선언 된 SDP_Assignment.Helpers.PaginatedList 네임 스페이스에는 없다.

+0

나는 YP_MVC_SDP_Assignment.Helpers.PaginatedList로 변경하려고 시도했으나 오류는 계속 발생합니다. =. = 제발 도와주세요 ... 꽤 붐 @습니다. @ Thx = D – 1myb

+0

아니요, 첫 번째 줄의보기 자체에서 변경하십시오. 'Inherits = "System.Web.Mvc.ViewPage >"' –

+0

고맙습니다 = D 마침내 해결 ^^ 기분이 좋네 ~ – 1myb