ASP.NET Basics (part 3): Hard Choices
(Page 1 of 8 )
In this third part of our introductory ASP.NET tutorial, learn all about C#'s logical and comparison operators with simple examples and illustrations. And while you're at it, get a crash course in adding decision-making logic to your ASP.NET programs with C#'s numerous conditional statements, including the "if", "if-else" and "switch" statements.With a little bit of luck, my previous article on C# left you so excited that you spent the last two weeks eagerly practicing variable names and letting your friends know how much smarter than them you are. And this week, I'm going to help you cement your reputation still further, by giving you a crash course in C#'s conditional statements.
I'll start with a gentle introduction to the comparison operator - the backbone for implementing a conditional statement. Next, I'll be introducing you to the most common conditional statement - the "if" statement. This is followed by the other members of the "if" family, namely the "if-else" and "if-else if-else" conditional statements. Finally, I'll show you how to get to grips with the "switch" conditional statement, the tool of choice when you want to avoid multiple "if-else if-else" branches in your code.
Make sure you're strapped in tight - this is gonna be one hell of a ride!
Next: Apples And Oranges >>
More ASP.NET Code Articles
More By Harish Kamath (c) Melonfire