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 data caching?

547


What is the server of asp.net?

504


What is a viewstate?

562


What are server objects?

511


What is http protocol and how it works?

525






What is the use of service provider?

584


What is distributed system in asp.net?

535


Describe the method to create a permanent cookie?

577


What is a page life cycle? What are the events in a page life cycle?

487


where can i gather the materials for MCP certification

4470


What is GAC in ASP.NET 2.0

581


What is the significance of attaching a profile while creating a user?

559


3. What goals do you have in your career?

1417


What is sta?

553


What are the main differences between asp and asp.net?

518