Front Controller / IHttpModule

Discussion in 'ASP .Net' started by moid, Dec 25, 2003.

  1. moid

    moid Guest

    Sir we are implementing front controller in asp.net.
    we implement three event-handler
    1. PreRequestHandlerExecute
    2. PostRequestHandlerExecute
    3. BeginRequest

    we just want to initialize the page, but dont want to load it.
    After BeginReq the page should Load.

    becuse we need to fill Datagrid through Command
    and then load it.

    is there any event in httpmodule that initialises page init events
    or is there some thing we are missing in whole here
    please help me.

    Thanks and Regards.
    Moid


    ------Code:-------------

    Public Class Handler
    Implements IHttpModule

    Public Sub Init(ByVal ctx As System.Web.HttpApplication) Implements System.Web.IHttpModule.Init
    AddHandler ctx.PreRequestHandlerExecute, AddressOf context_PreRequestHandlerExecute
    AddHandler ctx.PostRequestHandlerExecute, AddressOf context_PostRequestHandlerExecute
    AddHandler ctx.BeginRequest, AddressOf context_BeginRequest
    End Sub 'Init

    Private Sub pageInit(ByVal [source] As [Object], ByVal e As EventArgs)
    End Sub

    Private Sub context_BeginRequest(ByVal [source] As [Object], ByVal e As EventArgs)
    Dim application As HttpApplication = CType([source], HttpApplication)
    Dim context As HttpContext = application.Context.Current
    Dim session As HttpSessionState = context.Session

    Try
    Dim command As Command = CommandFactory.Make(context.Request.RawUrl)
    If Not (command Is Nothing) Then
    command.Execute(context)
    Else
    End If
    Catch
    End Try

    End Sub


    Public Sub Dispose() Implements IHttpModule.Dispose
    End Sub

    Private Sub context_PreRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs)
    '...Code
    End Sub 'context_PreRequestHandlerExecute


    Private Sub context_PostRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs)
    '...Code
    End Sub 'context_PostRequestHandlerExecute

    End Class
     
    moid, Dec 25, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Colin Basterfield

    Front Controller pattern!

    Colin Basterfield, Dec 10, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    1,413
    Colin Basterfield
    Dec 22, 2003
  2. moid
    Replies:
    0
    Views:
    414
  3. Magdelin
    Replies:
    2
    Views:
    776
    Magdelin
    Dec 22, 2003
  4. =?Utf-8?B?TXIgV2l6YXJk?=
    Replies:
    2
    Views:
    1,689
    =?Utf-8?B?TXIgV2l6YXJk?=
    Jan 5, 2004
  5. =?Utf-8?B?TkdN?=
    Replies:
    1
    Views:
    747
Loading...

Share This Page