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 round trip in asp.net?

699


If 200 is for all successful operation then why do we have 201 response codes?

726


Explain the differences between managed and unmanaged code?

705


what cut off mark for po's,what questions they asked for interview?

1640


Can we create a multiple user simultaneously ?

817


Will the asp.net validators run in server side or client side? How do you do client-side validation in .net?

705


Give 2 examples for scenarios when routing is not applied?

803


What is cross page posting in asp net?

726


What is asp.net web pages?

725


What is session id in web application?

785


What is the biggest disadvantage of “Other Return Types” in Web API?

1163


Define resource files.

751


Explain the differences between clr & cts?

765


Explain server side state management system.

745


What is an il?

749