Click here to Skip to main content
11,568,180 members (37,713 online)
   

ASP.NET

 
GeneralRe: How to Get Local Area IP Address? Pin
Nandan Basak4-Feb-13 2:05
memberNandan Basak4-Feb-13 2:05 
QuestionAn error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Pin
RKSPradeep4-Nov-12 20:11
memberRKSPradeep4-Nov-12 20:11 
JokeRe: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Pin
n.podbielski4-Nov-12 20:52
membern.podbielski4-Nov-12 20:52 
AnswerRe: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Pin
ryanb315-Nov-12 5:37
memberryanb315-Nov-12 5:37 
Questionvariable for aspx and all its ascx Pin
jrahma4-Nov-12 8:25
memberjrahma4-Nov-12 8:25 
AnswerRe: variable for aspx and all its ascx Pin
n.podbielski4-Nov-12 10:17
membern.podbielski4-Nov-12 10:17 
GeneralRe: variable for aspx and all its ascx Pin
Amir Jalilifard5-Nov-12 8:15
memberAmir Jalilifard5-Nov-12 8:15 
Questionhttpmodule, context.items.add("originalUrl") Pin
jkirkerx3-Nov-12 19:44
memberjkirkerx3-Nov-12 19:44 
I'm experimenting with the httpModule, using XP and IIS5.1, asp.net 4.0, in which I want to take a file called display.aspx?pNp=XXXX and turn it into a file name XXXX.aspx.

So I wrote the first part, I know what context.Items("originalUrl") is for, but I'm not sure if I actually need it, because I don't don't have the second part written or working yet. It's been awhile since my last 3 failures at attempting this.

I'd like to get another set of eyes on my code, before I procede, in case I really blew it here. And see if there are any mistakes.

It seems to work, and I get the error message below, so I figure it's ok.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.
 
Requested URL: /EN-US/part-lookup/catagory/XXXX.aspx
 

Imports Microsoft.VisualBasic
 
Public Class http_module_Details
    Implements IHttpModule
 
    Public Sub Init(context As System.Web.HttpApplication) Implements System.Web.IHttpModule.Init
 
        AddHandler context.BeginRequest, AddressOf context_BeginRequest
        AddHandler context.PreRequestHandlerExecute, AddressOf context_PreRequestHandlerExecute
        AddHandler context.EndRequest, AddressOf context_EndRequest
 
    End Sub
    Private Sub context_PreRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs)
 
        Dim application As HttpApplication = DirectCast(sender, HttpApplication)
        Dim context As HttpContext = application.Context
 
        If Not context.Items("originalUrl") Is Nothing Then
            context.RewritePath(Convert.ToString(context.Items("originalUrl")))
        End If
 
    End Sub
    Private Sub context_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
 
        Dim application As HttpApplication = DirectCast(sender, HttpApplication)
        Dim context As HttpContext = application.Context
 
        If (context.Request.RawUrl.ToLower.Contains("details.aspx")) Then
            context.Items("originalUrl") = context.Request.RawUrl
        End If
 
        Dim originalPath As String = context.Request.Url.ToString()
        If Not context.Request.QueryString("pNp") Is Nothing Then
            Dim cP As String = context.Request.ServerVariables("SCRIPT_NAME")
            cP = cP.Replace("Details.aspx", "").Replace("details.aspx", "")
            Dim pn_P As String = HttpUtility.UrlDecode(context.Request.QueryString("pNp"))
            Dim scriptName As String = cP & pn_P & ".aspx"
            context.RewritePath(scriptName)
        End If
 
    End Sub
    Private Sub context_EndRequest(ByVal sender As Object, ByVal e As EventArgs)
 

    End Sub
    Public Sub Dispose() Implements System.Web.IHttpModule.Dispose
 
    End Sub
 
End Class
 

Questionhow to split a page using frameset Pin
fahad.11-Nov-12 2:02
memberfahad.11-Nov-12 2:02 
AnswerRe: how to split a page using frameset Pin
jkirkerx4-Nov-12 7:58
memberjkirkerx4-Nov-12 7:58 
QuestionHow do I call a remote Web Service from an Asp.net application? Pin
Nada Adel31-Oct-12 23:28
memberNada Adel31-Oct-12 23:28 
AnswerRe: How do I call a remote Web Service from an Asp.net application? Pin
Keith Barrow1-Nov-12 5:54
mentorKeith Barrow1-Nov-12 5:54 
AnswerRe: How do I call a remote Web Service from an Asp.net application? Pin
Mathlab2-Nov-12 6:22
memberMathlab2-Nov-12 6:22 
AnswerRe: How do I call a remote Web Service from an Asp.net application? Pin
jkirkerx2-Nov-12 18:41
memberjkirkerx2-Nov-12 18:41 
Generalasp.net Pin
rifayee31-Oct-12 22:50
memberrifayee31-Oct-12 22:50 
GeneralRe: asp.net Pin
Think On1-Nov-12 4:39
memberThink On1-Nov-12 4:39 
GeneralRe: asp.net Pin
rifayee1-Nov-12 19:13
memberrifayee1-Nov-12 19:13 
GeneralRe: asp.net Pin
mark merrens1-Nov-12 13:16
membermark merrens1-Nov-12 13:16 
GeneralRe: asp.net Pin
Think On1-Nov-12 20:29
memberThink On1-Nov-12 20:29 
Questionwhat is different between DataAdapter.Update( ) and DataSetAcceptChange( ) in ADO.Net Pin
RKSPradeep31-Oct-12 19:58
memberRKSPradeep31-Oct-12 19:58 
AnswerRe: what is different between DataAdapter.Update( ) and DataSetAcceptChange( ) in ADO.Net Pin
Sandeep Mewara3-Nov-12 7:43
mvpSandeep Mewara3-Nov-12 7:43 
QuestionHow to implement a component that facilitates Sftp in .net Pin
Member 787327431-Oct-12 19:56
memberMember 787327431-Oct-12 19:56 
AnswerRe: How to implement a component that facilitates Sftp in .net Pin
Sandeep Mewara3-Nov-12 7:46
mvpSandeep Mewara3-Nov-12 7:46 
Questioncopy sheets one work book to other work book using open xml in windows azure Pin
prakashreddy1730-Oct-12 23:06
memberprakashreddy1730-Oct-12 23:06 
Questiondesign a master page Pin
RKSPradeep30-Oct-12 20:50
memberRKSPradeep30-Oct-12 20:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150624.2 | Last Updated 30 Jun 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid