Syntax analysis of nested If statements in ASP. NET Programming

Source: Internet
Author: User

The use of if in ASP. NET programming is very common, so we hope to help you with the format and usage of nested If statements in ASP. NET programming. Next, let's take a look.

Nested If statement

The format is as follows:

 
 
  1. If condition 1 Then
  2. If condition 2 Then
  3. Statement Block 1
  4. Else
  5. Statement Block 1-2
  6. End If
  7. Other statements
  8. Else
  9. Statement Block 2
  10. End If

ASP. in the NET programming, the so-called nested if statement is that the statement block in the If condition is also a set of if conditions, and the statement block is a set of if conditions, so repeat until the condition setting is complete.

Generally, the most complex conditional statements are nested conditional statements. All the conditional statements mentioned above can form nested conditional statements. As long as the syntax concept is clear, understand the "class relationship" between each condition and the statement block. nested conditional statements are not difficult.

Multi-execution path statement

The format is as follows:

Select Case data/Expression

 
 
  1. Case condition value 1
  2. Statement Block 1
  3. Case condition value 2
  4. Statement Block 2
  5. Case condition value 3
  6. Statement block 3
  7. Case condition value N
  8. Statement Block N
  9. CaSe ElSe
  10. Statement Block N + 1
  11. End Select

Multi-execution path refers to dividing the execution method of a program into multiple paths (the If statement has only two paths, I .e., whether the conditional statement is true or not ).

If the data or expression meets the condition value 1, execute statement Block 1. If the condition value 2 is met, execute statement Block 2. If the condition value 3 is met, execute statement Block 3, when the data or expression meets the condition value N, the statement Block N is executed. If all the condition values do not match, the statement Block N + 1 is executed.

The introduction of the if statement in ASP. NET programming is here. I hope it will help you.

  1. Analysis of ASP. NET Programming habits
  2. Introduction to ASP. NET JavaScript page Integration
  3. Analysis of JavaScript insertion methods in ASP. NET
  4. Analysis of ASP. NET JavaScript and ole db Design network diary
  5. Code Analysis of Cookie deletion in ASP. NET

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.