T
Trapulo
Running a Web Application I have this compilation error from ASP.NET:
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: BC30002: Type 'System.Web.Routing.IRouteHandler' is
not defined.
Source Error:
Line 47: ''' <remarks></remarks>
Line 48: Public Class ProductsRoutesHandler
Line 49: Implements System.Web.Routing.IRouteHandler
Line 50:
Line 51:
But my class is ok, and I can compile it from Visual Studio without any
problem... What can be?
This is my code:
Public Class ProductsRoutesHandler
Implements System.Web.Routing.IRouteHandler
''' <summary>
''' Maps "Products/product/{ProductID}" to "Products/product" with "ID"
in httpcontext("ProductID")
''' </summary>
''' <param name="requestContext"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Function GetHttpHandler(ByVal requestContext As
System.Web.Routing.RequestContext) As System.Web.IHttpHandler Implements
System.Web.Routing.IRouteHandler.GetHttpHandler
Dim productID As String =
requestContext.RouteData.GetRequiredString("ProductID")
Dim virtualPath As String = "~/Products/product.aspx"
System.Web.HttpContext.Current.Items("ProductID") = productID
Return
DirectCast(System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(virtualPath, GetType(Page)), System.Web.IHttpHandler)
End Function
End Class
thanks
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: BC30002: Type 'System.Web.Routing.IRouteHandler' is
not defined.
Source Error:
Line 47: ''' <remarks></remarks>
Line 48: Public Class ProductsRoutesHandler
Line 49: Implements System.Web.Routing.IRouteHandler
Line 50:
Line 51:
But my class is ok, and I can compile it from Visual Studio without any
problem... What can be?
This is my code:
Public Class ProductsRoutesHandler
Implements System.Web.Routing.IRouteHandler
''' <summary>
''' Maps "Products/product/{ProductID}" to "Products/product" with "ID"
in httpcontext("ProductID")
''' </summary>
''' <param name="requestContext"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Function GetHttpHandler(ByVal requestContext As
System.Web.Routing.RequestContext) As System.Web.IHttpHandler Implements
System.Web.Routing.IRouteHandler.GetHttpHandler
Dim productID As String =
requestContext.RouteData.GetRequiredString("ProductID")
Dim virtualPath As String = "~/Products/product.aspx"
System.Web.HttpContext.Current.Items("ProductID") = productID
Return
DirectCast(System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(virtualPath, GetType(Page)), System.Web.IHttpHandler)
End Function
End Class
thanks