Can we throw exception from catch Block?

Answer Posted / devender kumar

Yes. we can throw the exception from the catch block.
If anyone have confusion then try this code:


protected void Button1_Click(object sender, EventArgs e)
{
try
{
Test();
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
private void Test()
{
try
{
throw new Exception("Dev");
}
catch (Exception ex)
{
throw ex;
}
}

Is This Answer Correct ?    40 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is query string in asp.net?

811


Where do we store our connection string in asp.net application?

776


Explain ViewState?

808


What I need to create and run an asp.net application?

740


Why do we need asp.net?

799


Define authentication and authorization.

876


Explain how cookies work.

828


What are the features of asp.net mvc?

744


Explain what is an abstract class?

819


How many types of cookies are available in asp?

814


What is the difference between a candidate key and primary key?

784


How do you change the session time-out value?

808


Which validator control you use if you need to make sure the values in two different controls matched?

866


How do you declare static variable? What is its lifetime?

751


Where session variables are stored?

766