Dan

Dan

  • NA
  • 13
  • 0

Nested If and Try statements?

Dec 12 2007 6:47 PM

Im a bit new to C# and the syntax so please forgive my ignorance. I have a dotnet page using a C# code behind file and in the C# code there is a try/catch statement with some nested IF/ELSE statements inside it. I need to perform another validation after the initial TRY but before all the IF/ELSE statements. Can you open another try clause before closing it with a catch? Here is an example, Is that syntax correct and can you nest TRY's?

TRY
{
   TRY{
      IF {
            blah;
            }
      ELSE {
            blah;
            }
      CATCH {
      stuff;
      
}
CATCH {
blah;
}
}


Answers (1)