What kind of conditional statements does asp.net have, and how are they coded?
I'd like to see both VB and C#.
Here's a VB one I use:
If condition Then
<statements>
Else If condition Then
<statements>
Thank you.
|
|
|
|
|
|
|
long version for C#: (whitespace added for readability )
ternary operator for C#: (I haven't done this for a while, so feel free to correct me, fellow snippers!)
examples:
oodles more reading: http://msdn.microsoft.com/en-us/library/ty67wk28(VS.80).aspx I think there's also a ternary operator for vb using IIF, but I have less experience with that! |
||
|
|