ksd123
asked on
Need advice on try catch blocks in c#
Hi Experts,
I have web application with 8 buttons and each button has different functionality and am using try {} catch {} blocks in each button click event.
1)Can I use try,catch blocks this many times in a page ? Is this best practice?
2)Is there any differnce between below 2 statements?
a)Class1 obj;
obj=new Class1();
b)Class2 obj=new Class2();
Thanks in advance
I have web application with 8 buttons and each button has different functionality and am using try {} catch {} blocks in each button click event.
1)Can I use try,catch blocks this many times in a page ? Is this best practice?
2)Is there any differnce between below 2 statements?
a)Class1 obj;
obj=new Class1();
b)Class2 obj=new Class2();
Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you all.
try this tool for Error logging ; https://code.google.com/p/elmah/
2. No difference.