Click here to Skip to main content
16,019,043 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Suppose exception occurs in try blcok the control goes to catch block, if i have written the code in catch block like below
server.transfer("virtulapath")

will control executes above code block (which is in catch block) ? if yes then how

controller knows there is finally block or not ?
suppose if finally block also there. will it execute or not? if yes then how controller
knows there is finally block after navigating to specified virtual path?
Posted
Comments
ZurdoDev 8-Jul-13 13:37pm    
You seem to be asking homework questions.

1 solution

finally is a block which will execute in both conditions
If exception is caught or if not finally will execute for sure
Ya..if exception is caught then the control moves to catch block and whatever you have written in catch block will execute

for ex
try
{
}
catch
{
}
finally
{
Label1.text="Done";
}

Here whether exception occurs or not at the end label1 will have text "Done"
Read more try catch theory to understand yourself better.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900