The best ASP.NET Razor VB logic Tutorial In 2024, In this tutorial you can learn If conditions,Examples,Else Condition,Examples,ElseIf conditions,Examples,Select Condition,Examples,
Logic Programming: execute code conditionally.
VB permitted under the condition code execution.
Use an if statement to determine the conditions. According to the judgment result, if statement returns true or false:
else if statement may contain conditions.
else conditions defined code if the condition is false to be executed.
Note: In the example above, if the first condition is true, if the code block will be executed. else if conditions are covered in addition to the condition of "all other cases."
You can use multiple criteria to judge elseif conditions:
In the example above, if the first condition is true, if the code block will be executed.
If the first condition is not true and the second condition is true, the code elseif block will be executed.
Unlimited number of elseif conditions.
If the if and elseif conditions are not true, the last else block (without conditions) covers "all other cases."
select blocks can be used to test a number of separate conditions:
Behind "Select Case" followed by the value of the test (day). Each individual case has a value test conditions and any number of lines of code. If the test value matches the value of the case, the corresponding line of code is executed.
select block has a default (Case Else), when all the specified circumstances do not match, it covers "all other cases."