HttpModule is not initialized on your servers?

Discussion in 'ASP.NET / ASP.NET Core' started by saeed homsy, Oct 6, 2011.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Dears DiscountAsp.net support

    the following attached code is working properly on my machine but doesn't even executed on yours.

    I believe that the httpModule is not attached as you can see from the attached code




    Private Sub Application_OnAfterProcess(ByVal source As Object, ByVal e As EventArgs)
    Dim application As HttpApplication = DirectCast(source, HttpApplication)
    Dim context As HttpContext = application.Context

    'we have added this line to prove that this method is not executed
    context.Response.Redirect("http://www.google.com")
    Exit Sub

    'the file being requested is not found
    If Not File.Exists(application.Request.PhysicalPath) Then
    If application.Request.Url.Segments(1) = "categories/" Then
    Dim newURL As String = "category.aspx?categoryid=" & application.Request.PhysicalPath.Split("\")(application.Request.PhysicalPath.Split("\").Length - 1).Split(".")(0)
    context.RewritePath(newURL)
    ElseIf application.Request.Url.Segments(1) = "services/" Then
    Dim newURL As String = "serviceortrack.aspx?serviceortrackid=" & application.Request.PhysicalPath.Split("\")(application.Request.PhysicalPath.Split("\").Length - 1).Split(".")(0)
    context.RewritePath(newURL)
    ElseIf application.Request.Url.Segments(1) = "qa/" Then
    Dim newURL As String = "serviceortrack.aspx?serviceortrackid=" & application.Request.PhysicalPath.Split("\")(application.Request.PhysicalPath.Split("\").Length - 1).Split(".")(0)
    context.RewritePath(newURL)
    ElseIf application.Request.Url.Segments(1) = "blog/" Then
    Dim newURL As String = "serviceortrack.aspx?serviceortrackid=" & application.Request.PhysicalPath.Split("\")(application.Request.PhysicalPath.Split("\").Length - 1).Split(".")(0)
    context.RewritePath(newURL)
    End If


    End If
    End Sub
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    what platform are you on? IIS6 / 7?

    What is the pipeline mode ? Classic / Integrated?
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page