Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Page redirection

Page redirection

Scheduled Pinned Locked Moved ASP.NET
question
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mr Sam
    wrote on last edited by
    #1

    Is there a page event called when we use response.redirect to redirect to any other page? The reason is that i want to perform some actions just before the page is redirected. Thx in advance

    Bye

    _ P 2 Replies Last reply
    0
    • M Mr Sam

      Is there a page event called when we use response.redirect to redirect to any other page? The reason is that i want to perform some actions just before the page is redirected. Thx in advance

      Bye

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      Then what is the issue? First perform the actions and then redirect the user to the desired page.

      Apurva Kaushal

      1 Reply Last reply
      0
      • M Mr Sam

        Is there a page event called when we use response.redirect to redirect to any other page? The reason is that i want to perform some actions just before the page is redirected. Thx in advance

        Bye

        P Offline
        P Offline
        Prateek G
        wrote on last edited by
        #3

        I am a bit apprehensive whether it will work or not.. Try it once..I wrote a code for a similar requirement and its working .... u can call some events.. u will have create a different class public void Init(HttpApplication context) { (IsDisposed) { throw (new ObjectDisposedException(this.ToString())); } else { context.BeginRequest +=new EventHandler(context_BeginRequest); context.EndRequest += new EventHandler(context_EndRequest); } } //This function will get called before ending exection of any page. private void context_EndRequest(object sender, EventArgs e) { if (((HttpApplication)sender).Context.CurrentHandler.ToString() != "UR_PAGE_NAME") { //Ur Code } }

        M 1 Reply Last reply
        0
        • P Prateek G

          I am a bit apprehensive whether it will work or not.. Try it once..I wrote a code for a similar requirement and its working .... u can call some events.. u will have create a different class public void Init(HttpApplication context) { (IsDisposed) { throw (new ObjectDisposedException(this.ToString())); } else { context.BeginRequest +=new EventHandler(context_BeginRequest); context.EndRequest += new EventHandler(context_EndRequest); } } //This function will get called before ending exection of any page. private void context_EndRequest(object sender, EventArgs e) { if (((HttpApplication)sender).Context.CurrentHandler.ToString() != "UR_PAGE_NAME") { //Ur Code } }

          M Offline
          M Offline
          Mr Sam
          wrote on last edited by
          #4

          Prateek G wrote:

          public void Init(HttpApplication context) { (IsDisposed) { throw (new ObjectDisposedException(this.ToString())); }

          What is this IsDisposed, im getting error on it in vb.net. Also tell me who will set the value of the context and can I integrate it directly to the Page_Init event.

          Bye

          P 1 Reply Last reply
          0
          • M Mr Sam

            Prateek G wrote:

            public void Init(HttpApplication context) { (IsDisposed) { throw (new ObjectDisposedException(this.ToString())); }

            What is this IsDisposed, im getting error on it in vb.net. Also tell me who will set the value of the context and can I integrate it directly to the Page_Init event.

            Bye

            P Offline
            P Offline
            Prateek G
            wrote on last edited by
            #5

            ohh I am sorry, Remove that if condition dont use it....

            M 1 Reply Last reply
            0
            • P Prateek G

              ohh I am sorry, Remove that if condition dont use it....

              M Offline
              M Offline
              Mr Sam
              wrote on last edited by
              #6

              public void Init(HttpApplication context) { (IsDisposed) { can you please tell me how to get the httpApplication context in my page_init parameters or if it is a method when shud i call it and what parameter shud i pass in it

              Bye

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups