Esto funciona perfecto con el depurador de vs.2010, pero al subirlo al hosting no funciona, el hosting tiene iis6, framework 3.5 sp1, con lo cual debiera de funcionar, pero no.
alguien sabe que se puede hacer para que funcione, adjunto codigos, y espero su ayuda, gracias
IROUTING.VB
Código ASP:
Ver original
Imports System.Web Imports System.Web.Routing Imports System.Web.UI Imports System.Web.Compilation Public Class iRouting Implements IRouteHandler Private _virtualPath As String Public Sub New(ByVal vPath As String) _virtualPath = vPath End Sub Public Property VirtualPath() As String Get Return _virtualPath End Get Private Set(ByVal value As String) _virtualPath = value End Set End Property Public Function GetHttpHandler(ByVal requestContext As System.Web.Routing.RequestContext) As System.Web.IHttpHandler Implements System.Web.Routing.IRouteHandler.GetHttpHandler Dim queryString As New StringBuilder("?") For Each value In requestContext.RouteData.Values Dim mykey As String = requestContext.HttpContext.Server.UrlEncode(value.Key) Dim myvalue As String = requestContext.HttpContext.Server.UrlEncode(value.Value.ToString) queryString.Append(String.Format("{0}={1}&", mykey, myvalue)) Next If queryString.Length > 1 Then queryString.Remove(queryString.Length - 1, 1) HttpContext.Current.RewritePath(String.Concat(VirtualPath, queryString), False) End If Dim redirectPage As IHttpHandler = DirectCast(BuildManager.CreateInstanceFromVirtualPath(VirtualPath, GetType(Page)), IHttpHandler) Return redirectPage End Function End Class
GLOBAL.ASA
Código ASP:
Ver original
Imports IronClass Imports System.Web.SessionState Imports System.Web.Routing Public Class Global_asax Inherits System.Web.HttpApplication Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) RegisterRoutes(RouteTable.Routes) End Sub Shared Sub RegisterRoutes(ByVal routes As RouteCollection) routes.Add(New Route("offline", New iRouting("offline.aspx"))) routes.Add(New Route("", New iRouting("/index.aspx"))) End Sub End Class
WEB.CONFIG
Código ASP:
Ver original
<system.web> <compilation debug="true" strict="false" explicit="true"> <assemblies>...</assemblies> </compilation> <pages> <namespaces>...</namespaces> <controls>...</controls> </pages> <httpHandlers>...</httpHandlers> <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </httpModules> </system.web>