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 query string in asp.net?
Where do we store our connection string in asp.net application?
Explain ViewState?
What I need to create and run an asp.net application?
Why do we need asp.net?
Define authentication and authorization.
Explain how cookies work.
What are the features of asp.net mvc?
Explain what is an abstract class?
How many types of cookies are available in asp?
What is the difference between a candidate key and primary key?
How do you change the session time-out value?
Which validator control you use if you need to make sure the values in two different controls matched?
How do you declare static variable? What is its lifetime?
Where session variables are stored?