2013-01-11 7 views
0

우리가 같은 이름 공간이 개 클래스를 고려하고 IHttpHandler를 확장하자 1 급 하는 ASP.NET HTTP 모듈 만들기

아래 :

using System; 
using System.Web; 
using System.IO; 

namespace MyPipeLine 
{ 
    public class clsMyHandler1 : IHttpHandler 
    { 
      public void ProcessRequest(System.Web.HttpContext context) 
      { 
       context.Response.Write("The page request is " + context.Request.RawUrl.ToString()); 
      } 

    } 

    public bool IsReusable 
    { 
      get 
      { 
       return true; 
      } 
    } 
} 

2 등급 :

using System; 
using System.Web; 
using System.IO; 

namespace MyPipeLine 
{ 
    public class clsMyHandler2 : IHttpHandler 
    { 
      public void ProcessRequest(System.Web.HttpContext context) 
      { 
       context.Response.Write("The page request is " + context.Request.RawUrl.ToString()); 

      } 

      public bool IsReusable 
      { 
       get 
       { 
        return true; 
       } 
      } 
    } 
} 

네임 스페이스는 다음과 같습니다. 두 클래스가있는 MyPipeLine clsMyHandler1, clsMyHandler2

에 의해이은 내가

<system.webServer> 
    <modules> 
     <add name="mymodule" type="MyPipeLine.clsMyHandler1,MyPipeLine.clsMyHandler2" /> 
     </modules>   
</system.webServer> 

으로 web.config 파일에서 항목을 부여하고 내가 응용 프로그램을 컴파일 할 때 파일이나 어셈블리 'MyPipeLine를로드 할 수 없습니다

로 나에게 오류가 발생. clsMyHandler2 '또는 그 종속성 중 하나가됩니다. 시스템이 지정된 파일을 찾을 수 없습니다.

나는 C 클래스가 모든 모듈을 클래스라고 생각합니다. 이 문제를 해결할 생각이 있습니까?

답변

1

HTTP 처리기 용 모듈을 만들고 인터페이스를 구현하려고합니다. 이것을 사용하십시오 IHttpModule

+0

나는 모듈을 만들었지 만 각 요청마다 한 번에 두 개의 클래스를 시작해야하지만 – GowthamanSS

+0

두 클래스 모두에서 IHTTPHandler를 구현하고 있습니다. 얻는 오류는 IHttpModule을 구현하지 않기 때문입니다. –

+0

이 공용 클래스처럼 간다 clsMyHandler2 : IHttpModule –