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. Can i put Response.Redirect("errorpage.aspx") in Application_Error()?

Can i put Response.Redirect("errorpage.aspx") in Application_Error()?

Scheduled Pinned Locked Moved ASP.NET
sysadminhelpquestion
5 Posts 4 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.
  • A Offline
    A Offline
    adkalavadia
    wrote on last edited by
    #1

    In Global.asax, I have put... void Application_Error(object sender, EventArgs e) { Exception objErr = Server.GetLastError().GetBaseException(); ErrorLog.WriteError(objErr.Message);//Fn Write error into text file Response.Redirect("~/admin/ErrorPage.aspx"); } When error occure then all loggedin user got redirect to errorpage?or only the use who got error is redirect to error page?please give reply ASAP. Thanks in advance.

    !- F - R - I - E - N - D - S -!

    Q S P 3 Replies Last reply
    0
    • A adkalavadia

      In Global.asax, I have put... void Application_Error(object sender, EventArgs e) { Exception objErr = Server.GetLastError().GetBaseException(); ErrorLog.WriteError(objErr.Message);//Fn Write error into text file Response.Redirect("~/admin/ErrorPage.aspx"); } When error occure then all loggedin user got redirect to errorpage?or only the use who got error is redirect to error page?please give reply ASAP. Thanks in advance.

      !- F - R - I - E - N - D - S -!

      Q Offline
      Q Offline
      Qasim1984
      wrote on last edited by
      #2

      Only the user that have error should redirect to errorpage.

      A 1 Reply Last reply
      0
      • Q Qasim1984

        Only the user that have error should redirect to errorpage.

        A Offline
        A Offline
        adkalavadia
        wrote on last edited by
        #3

        Thanks for reply...can u give some explaination? I think this event is called at application level.

        !- F - R - I - E - N - D - S -!

        1 Reply Last reply
        0
        • A adkalavadia

          In Global.asax, I have put... void Application_Error(object sender, EventArgs e) { Exception objErr = Server.GetLastError().GetBaseException(); ErrorLog.WriteError(objErr.Message);//Fn Write error into text file Response.Redirect("~/admin/ErrorPage.aspx"); } When error occure then all loggedin user got redirect to errorpage?or only the use who got error is redirect to error page?please give reply ASAP. Thanks in advance.

          !- F - R - I - E - N - D - S -!

          S Offline
          S Offline
          sashidhar
          wrote on last edited by
          #4

          Why Did U need..! Try to configure in web.config file..! and write the server last error in log file

          LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.

          1 Reply Last reply
          0
          • A adkalavadia

            In Global.asax, I have put... void Application_Error(object sender, EventArgs e) { Exception objErr = Server.GetLastError().GetBaseException(); ErrorLog.WriteError(objErr.Message);//Fn Write error into text file Response.Redirect("~/admin/ErrorPage.aspx"); } When error occure then all loggedin user got redirect to errorpage?or only the use who got error is redirect to error page?please give reply ASAP. Thanks in advance.

            !- F - R - I - E - N - D - S -!

            P Offline
            P Offline
            Palash Biswas
            wrote on last edited by
            #5

            Use public void Page_Error(Object sender, EventArgs e) Event in your all Page.. Or Write a Class inherited from System.Web.UI.Page say Base.cs and write the Page_Error Event there and Inherit your all Page from from Base

            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