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
What is virtual directory in asp.net?
How does u get record no from 5 to 15 from a dataset of 100 records?
What is the asp.net mvc folder conventions? : asp.net mvc
What is the difference between exe and dll?
Explain automatic memory management in .net.
Can the validation occurs in server-side or client-side? If the validation occurs why should we do?
What is repository pattern in mvc.net? : asp.net mvc
Why is an object pool required?
What is Razor View Engine
What can you do with asp.net?
In asp.net, how can you validate drop down box?
Which protocol is used to call web service?
What is the use of asp.net web api?
How do you do Client-side validation in .Net?
What are the types of caching in asp.net?