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 are the events raised in asp.net page life cycle?in which stage view state can be loaded?

557


Which authentication uses a combination of windows and iis authentication?

591


How can you apply a theme to your asp.net application?

539


What is a session government?

505


How can we register exception filter globally?

592






Which protocol is used in a web api?

568


What is data binding in asp net?

593


Which two new properties are added in asp.net 4.0 page class?

529


What is the postback property in asp.net?

544


How to set the pane area to transparent of a scrollPane component.?

569


What is meant by web application?

548


Can one dll file contains the compiled code of more than one .net language?

540


Is asp.net free?

555


What are validators and list some validators of asp.net?

546


Explain the difference between an exe and a dll?

531