473,788 Members | 2,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to trap this error with global.asax?

Hi,

When an user tries to update a record in a gridview with a duplicate value,
there comes an error like:
"The changes you requested to the table were not successful because they
would create duplicate values in the index etc ..."

I tried to solve that with the errorPage like this:
<%@ Page Language="VB" CodeFile="mult. aspx.vb" Inherits="mult"
errorPage="err2 .html" %>
and to set in web.config this:
<customErrors mode="On">
</customErrors>

This works, but is this the best way? I would like to do that for all pages
with global.asax.

I did this:
Sub Application_Err or(ByVal sender As Object, ByVal e As EventArgs)
Dim ex As Exception
ex = Server.GetLastE rror()
Throw ex
End Sub

But of course, there must be more code. But here I'm stuck ...

Any help would be appreciated
Thanks
Averell
May 29 '06 #1
0 942

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
19872
by: Pa Ji | last post by:
I just created a simple web application and tried to run it. Getting following...any idea what I'm missing Thanks in advance ---------------------------------------------------------------------------- ---- Server Error in '/test2' Application. ---------------------------------------------------------------------------- ----
5
2252
by: CES | last post by:
All, I've just started to use VBStudio, up tell now I've coded with note pad, so this is all new to me. I'm trying to create my first project but I'm running into problems. I've created a base ASP.net web application and used the default name WebApplication1. Without doing !!anything!! to the WebForm1.aspx I build the project by going to File Menu Build\Build Solution (Ctr+Shift+B) : In the Output window I get:
0
3837
by: Jack Wright | last post by:
Dear All, I have a web Application "http://localhost/Web/WebForm1.aspx" that calls a WebService from "http://localhost/webserviceapp/service1.asmx"...I have set the executionTimeout to 10 secs in Web.Config where my WebService is installed. <httpRuntime executionTimeout="10" appRequestQueueLimit="2" /> When I call a method "TestPlan" which takes more than 10 secs my web Page gets the following error:
14
2399
by: Roland Hall | last post by:
Since I'm not getting any response from the community, I'm reposting this under my managed account. I've turned my web.config friendly error messages off and it may be easier to view what I'm experiencing than try to translate it. Here's the error: Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="netfraud.us.Global" %>
1
4702
by: Neil | last post by:
Hello - In every project I try to compile and run, I'm getting a parser error on global.asax (pasted below). I have rebuilt and recompiled, and this happens on every project on my machine, no matter how simple or complex. For example purposes, I even created a new app using all the defaults in VS.Net 2003 (WebApplication1, WebForm1) and dropped a label on WebForm1, did a Ctrl-F5 and still get the error. I have tried reinstalling the .NET...
5
1230
by: Andrew | last post by:
Hello, friends, In our development machine, the .net web app worked fine. Then we deployed it to our server. However, it did not work on the server. After a user entered user name/pswd and tried to log in, we have the error message in Exception : Thread was being aborted in Page_Load(). Page_Load()
5
1492
by: Doug | last post by:
Found this thread, but code is C# (would rather have VB.NET). http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q306355 Can anyone point me to a simple solution? We don't want the error codes appearing to the end-user, but obviously we want to be able to log and e-mail them, etc. According to what I've been reading, the way to accomplish this is to change the "CustomErrors" mode and the 'defaultRedirect' in web.config,
4
3047
by: Al Santino | last post by:
Hello, I've created a simple C# web services project using Visual Studio 2005. My service compiles and runs correctly when called by remote clients. I'm able to step through the service in the debugger unless I add a Global.asax file. When I do that and then try to run the debugger I receive error 403. If I remove the Global.asax file things work fine. The Global.asax file is the one generated by VS 2005 - I don't try to add anything...
1
1795
by: =?Utf-8?B?QWNl?= | last post by:
hello, i just converted old .net project (it was a solution with web project and class project) built in .net 1.0 and 1.1 framework to .net 2.0. as i expected, when i clicked on the solution file from vs 2005, it went through a conversion process and all seemed to go ok. when i attempt to run, i get first parser error on global.asax and cs. i still have global.asax and global.asax.cs attached together (as code-behind). after few...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.