CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_web_developer_2005_express Tags:
Item Type: NewsGroup Date Entered: 7/8/2007 7:08:15 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 17 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
Suryansu
Asp.Net User
Problem in exception handling7/8/2007 7:08:15 AM

0/0

hi.....I have written in button click event a complex code

button_click

'complex code

response.reditect(error.aspx) 

end sub

this code works fine................but when i am adding try and catch and ex as exception.that time one exception is generated ..(Thread is being aborted).

But without try catch statement.the code wortks finee............

so how to avoid that exception as i have to write try ,catch startement..............

 

e_screw
Asp.Net User
Re: Problem in exception handling7/8/2007 8:54:05 AM

0/0

Response.Redirect("somepage") will throw ThreadAbortException and will be caught if you are using the Response.Redirect inside a try catch block. To avoid the exception you need to pass in the endResponse (= false) value using the other overload of the Response.Redirect so that the current executing thread will not be aborted.

 

Try
	Response.Redirect("error.aspx", False)

Catch
End Try

Thanks

Its not so easy to do... So you are here!

Electronic Screw
Website||Blog||[email protected]
Suryansu
Asp.Net User
Re: Problem in exception handling7/8/2007 11:15:24 AM

0/0

 

Nice Answer.its working fine,............

II have another question.......How do i go for exception handling for a project..............can u give any suggesting.......like i will create  a page....

i code behind i will write

for example

case 400

databse connection  error

case 401

network error.....

cae 403

file not found

 

Or is there any better way.........

 

Kindly give ur suggestion BRIEFLY..........Thanks once again for the answer u gave..........

e_screw
Asp.Net User
Re: Problem in exception handling7/8/2007 11:42:18 AM

0/0

Its tough to know what kind of exception will be raised, lest you would sure avoid it. Also you cant write for all the cases, as there are numerous exceptions that can be raised. One good way is General Exception Handling

Also read this : http://www.codeproject.com/aspnet/ASPNETExceptionHandling.asp

Thanks

-Mark the post as answered, if your question was answered by this post!


Its not so easy to do... So you are here!

Electronic Screw
Website||Blog||[email protected]
Benson Yu - MSF
Asp.Net User
Re: Problem in exception handling7/9/2007 7:23:13 AM

0/0

Hi Suryansu,

e_screw has given you the right answer for the original issue. It would be best if you open up a new thread for the new question. In this way, our discussion here will not deviate too much from the original issue. This will make answer searching in the forum easier and be beneficial to other community members as well.

For the new issue, I think we can use the statusCode and redirect element in customErrors section. For example:

How to: Create Web.config Files (Visual Studio)
http://msdn2.microsoft.com/en-us/library/k8x4ket8(VS.80).aspx

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm"/>
            <error statusCode="404" redirect="FileNotFound.htm"/>
        </customErrors>

 


Sincerely,
Benson Yu
Microsoft Online Community Support

Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
C++ how to Program: How to Program Authors: Paul J. Deitel, Pages: 1429, Published: 2008
Telecommunications Billing Systems: Implementing and Upgrading for Profitability Authors: Jane M. Hunter, Maud E. Thiebaud, Pages: 458, Published: 2003
Pro C# 2008 and the .NET 3.5 Platform Authors: Andrew Troelsen, Pages: 1370, Published: 2007
C# 3.0 Cookbook Authors: Jay Hilyard, Stephen Teilhet, Pages: 886, Published: 2007
Object-oriented Technology: ECOOP 2000 Workshop Reader : ECOOP 2000 Workshops, Panels, and Posters, Sophia Antipolis and Cannes, France, June 12-16, 2000 : Proceedings Authors: Jacques Malenfant, Sabine Moisan, Ana M. D. Moreira, Pages: 308, Published: 2000
C# for Programmers: Updated for C# 2.0 Authors: Paul J. Deitel, Pages: 1317, Published: 2005
Grid and Cooperative Computing: Second International Workshop, GCC 2003, Shanhai [sic], China, December 7-10 2003 : Revised Papers Authors: Minglu Li, Pages: 1076, Published: 2004
C# Cookbook Authors: Jay Hilyard, Stephen Teilhet, Pages: 1154, Published: 2006
Secure Programming Cookbook for C and C++: Recipes for Cryptography, Authentication, Input Validation & More Authors: John Viega, Matt Messier, Pages: 762, Published: 2003
Visual C# 2005: How to Program Authors: Harvey M. Deitel, Paul J. Deitel, Pages: 1591, Published: 2006

Web:
Exception handling - Wikipedia, the free encyclopedia These tools are called Automated Exception Handling or Error ..... Problems and Benefits of Exception Handling · Understanding and Using Exceptions in . ...
Neil Fraser: Writing: Exception Handling Exception handling is often used as the lazy way out of a problem. Not sure exactly why something is failing intermittently? Don't bother investigating, ...
[magick-users] problem with exception handling [magick-users] problem with exception handling. Steven K Shapiro sshapiro at rosettatechnologies.com Thu Mar 10 14:46:01 PST 2005 ...
Best Practices for Exception Handling | O'Reilly Media One of the problems with exception handling is knowing when and how to use it. In this article, I will cover some of the best practices for exception ...
Error and Exception Handling Because actually handling an exception is likely to be significantly slower ... problems at the catch-site in case someone throws an exception derived from ...
Exception Handling in Software Development Feb 20, 2008 ... Exception handling I have encountered developers who say “I know this ... The problem with this is that the team was now painted into a ...
Exception Handling: A False Sense Of Security Explains why most members of the C++ community vastly underestimate the skills needed to program with exceptions and therefore underestimate the true costs ...
Exception handling problems in Java, Part I Exception handling problems in Java, Part I, Java's type system has a serious flaw. It does not allow refactoring common exception handling code into ...
[jbpm-issues] [JBoss JIRA] Created: (JBPM-1162) Problem with ... Apr 23, 2008 ... Problem with exception handling within the Decision nodes ---------------------- ----------------------------------- Key: JBPM-1162 URL: ...
Problem with exception handling in shared libs on Solaris To: egcs-bugs at cygnus dot com; Subject: Problem with exception handling in shared libs on Solaris; From: "Keller, Steve" ...

Videos:
Kevin Frei @ NWCPP: Exception Handling Cost Kevin Frei - Exception Hanlding Cost September 2006 meeting of the Northwest C++ Users Group. Discussion of the assembly language cost of exception ...
Lecture - 23 Processor Design Exception Handling Lecture Series on Computer Architecture by Prof. Anshul Kumar, Department of Computer Science & Engineering ,IIT Delhi. For more details on NPTEL vis...
Tutorial: Exception handling in JAVA A presentation how to handle exceptions in JAVA or other object-oriented programming languages
Dan Ingalls: Object-Oriented Programming Lecture about OOP given by Smalltalk Developer Even in our days, where object-oriented programming is widely accepted, it is still not very well und...
Java Video Tutorial 9: Exceptions The basics of exception handling. Sorry for the delay (Of 7 months...).
Teach Yourself Extended BASIC 7 CHAPTER 7. Exception Handling. ON BREAK, ON ERROR, ON WARNING, CALL ERR, RETURN texintreasures.com
GCCINSTALL #24 Installing the GNU Compiler Collection http://gcc.gnu.org/install/ : namespace is required for an entire build. This problem can be avoided in a number of ways. With ...
Second Look - Spiral Island map editor Second look at the map editor I am creating to assist with the creation of Spiral Island, an XNA title I am working on to be released on XBOX Live Co...
012-Important Note for PL/SQL to remember (Oracle Training) Basic information about PL/SQL you must know before doing any hands-on. PL/SQL is a language that was provided by Oracle. Stored procedure is a colle...
soc 25 system level test bench .corner case . boundary conditions .error conditions . exception handling




Search This Site:










web site administration tool

formsauthentication.authenticate

elearning

parse membership/provider attributes

free skinning mp3 interview

web service using active directory user validation in asp.net

debugger not working

error while editing

asp.net component problem

how can i design masterpage center aligned?.

attn: developers - dotnetnuke module to do list

growing tree view

flash object hiding solpart menu

recomended way of accessing controls in master?

timeout error on logging in to web application

problems

help? portals and parent/child pages

giving css to html tables in master page.

forum module

replace username by email to login

expanding ie tree web control

how to import/open ibuyspy with vs.net

microsoft.scalablehosting.profile.sqlprofileprovider does not fit into one to many relationship

error installing dotnetnuke 4.0???? ((could not connect to database).

default user database does not auto generate

visual studio 2005 profiler "launch error: the web.config file xxx\web.config has been changed and backup information was lost."

expert: custom profile provider issues

portalsecurity.isinrole() problems

integrate asp.net applications with dnn

how is create run time divs and passing value in database?

 
All Times Are GMT