Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3979980
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:14:11+00:00 2026-05-20T05:14:11+00:00

I like to user custom errors in my site. The Idea is to trap

  • 0

I like to user custom errors in my site.
The Idea is to trap errors and display friendly meaningful messages to users.
The real error details (line number, Page …) will sent to me by e-mail.
I am programming in VB.NET.
Until now every code that i found about this say’s that i must use the global.asax for it.
I do not like to use global.asax, I just like to make an error page that will sent me a -email with all the error details.
Until now, i go to the web.config file and insert this line:

<customErrors defaultRedirect="test.aspx" mode="On"></customErrors>

test.aspx looks like this:

Sub Page_Error(sender as Object, e as EventArgs) Dim ctxOBJ As HttpContext Dim exceptionOBJ As Exception Dim errorInfoTXT As String ctxOBJ = HttpContext.Current() exceptionOBJ = ctxOBJ.Server.GetLastError() errorInfoTXT = "
Offending URL: " & ctxOBJ.Request.Url.ToString() & _ "
Source: " & exceptionOBJ.Source.ToString() & _ "
Message: " & exceptionOBJ.Message.ToString() & _ "
Stack trace: " & exceptionOBJ.StackTrace.ToString() & _ "

Target Site: " & exceptionOBJ.TargetSite.ToString() ctxOBJ.Response.Write (errorInfoTXT) ctxOBJ.Server.ClearError () End Sub

When here is an error in some page its redirect me to test.aspx but not showing any error.

Thanks,

Roy Shoa.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:14:12+00:00Added an answer on May 20, 2026 at 5:14 am

    You just need to change this to

    Sub Page_Load(sender as Object, e as EventArgs)
    

    It’s not the error page that’s erroring, so its error event never fires.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to find a way to use custom User provider within a
I would like to add some custom data to an image the user generates
I would like to give the user the ability to insert custom elements in
My site is completely custom, as such I like to know when I have
Users can access others users profiles like this: site.com/username My find method in my
we've created a custom webpart to display announcements from all lists a user has
I use the error handling for my custom functions, and notice all three user
Can I configure ASP.NET custom errors so that it would redirect to other site
We are currently using a custom error page for 404 errors for our Web
How do I make something like user-defined __repr__ in Python? Let's say I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.