Click here to Skip to main content
15,886,678 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to Get Local Area IP Address? Pin
Nandan Basak4-Feb-13 2:05
Nandan 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
RKSPradeep4-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
n.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
ZurdoDev5-Nov-12 5:37
professionalZurdoDev5-Nov-12 5:37 
Questionvariable for aspx and all its ascx Pin
Jassim Rahma4-Nov-12 8:25
Jassim Rahma4-Nov-12 8:25 
AnswerRe: variable for aspx and all its ascx Pin
n.podbielski4-Nov-12 10:17
n.podbielski4-Nov-12 10:17 
GeneralRe: variable for aspx and all its ascx Pin
Amir Jalilifard5-Nov-12 8:15
professionalAmir Jalilifard5-Nov-12 8:15 
Questionhttpmodule, context.items.add("originalUrl") Pin
jkirkerx3-Nov-12 19:44
professionaljkirkerx3-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
fahad.11-Nov-12 2:02 
AnswerRe: how to split a page using frameset Pin
jkirkerx4-Nov-12 7:58
professionaljkirkerx4-Nov-12 7:58 
QuestionHow do I call a remote Web Service from an Asp.net application? Pin
Nada Adel31-Oct-12 23:28
Nada 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
professionalKeith Barrow1-Nov-12 5:54 
AnswerRe: How do I call a remote Web Service from an Asp.net application? Pin
CafedeJamaica2-Nov-12 6:22
professionalCafedeJamaica2-Nov-12 6:22 
AnswerRe: How do I call a remote Web Service from an Asp.net application? Pin
jkirkerx2-Nov-12 18:41
professionaljkirkerx2-Nov-12 18:41 
Generalasp.net Pin
rifayee31-Oct-12 22:50
rifayee31-Oct-12 22:50 
GeneralRe: asp.net Pin
Think On1-Nov-12 4:39
Think On1-Nov-12 4:39 
GeneralRe: asp.net Pin
rifayee1-Nov-12 19:13
rifayee1-Nov-12 19:13 
GeneralRe: asp.net Pin
R. Giskard Reventlov1-Nov-12 13:16
R. Giskard Reventlov1-Nov-12 13:16 
GeneralRe: asp.net Pin
Think On1-Nov-12 20:29
Think On1-Nov-12 20:29 
Questionwhat is different between DataAdapter.Update( ) and DataSetAcceptChange( ) in ADO.Net Pin
RKSPradeep31-Oct-12 19:58
RKSPradeep31-Oct-12 19:58 
AnswerRe: what is different between DataAdapter.Update( ) and DataSetAcceptChange( ) in ADO.Net Pin
Sandeep Mewara3-Nov-12 7:43
mveSandeep Mewara3-Nov-12 7:43 
QuestionHow to implement a component that facilitates Sftp in .net Pin
Alesha Mary Milred Fernandes31-Oct-12 19:56
Alesha Mary Milred Fernandes31-Oct-12 19:56 
AnswerRe: How to implement a component that facilitates Sftp in .net Pin
Sandeep Mewara3-Nov-12 7:46
mveSandeep 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
prakashreddy1730-Oct-12 23:06 
Questiondesign a master page Pin
RKSPradeep30-Oct-12 20:50
RKSPradeep30-Oct-12 20:50 

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

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