The statement block in the If condition is also a group of if conditions, and the statement block is a group of if conditions.
Until the condition is set.
In general, the most complex conditional statements are nested conditional statements.
All conditional statement formats can form nested conditional statements, as long as the syntax concept is clear
Chu
If then
<Script runat = "server">
Sub Page_Load (Sender as object, e as eventargs)
Dim MyMessage As String = "Hello"
Dim MyBool As Boolean = True
If MyMessage = "Hello" then
Response. Write ("True ")
End if
If MyBool then
Response. Write ("True ")
End if
End sub
</Script>
The following is a complex statement.
If condition 1 Then
If condition 2 Then
Statement Block 1
Else
Statement Block 1-2
End I f
Other statements
Else
Statement Block 2
End If
Simple instance
<% @ Page Language = "C #" %>
<Script runat = "server">
Void Page_Load (Object Sender, EventArgs e ){
String MyMessage = "Hello ";
Bool MyBool = true;
If (MyMessage = "Hi" & MyBool ){
Response. Write (MyMessage );
} Else if (MyMessage = "Hello "){
Response. Write ("True ");
} Else {
Response. Write ("False ");
}
If (! MyBool ){
Response. Write ("False ");
}
}
</Script>
<Html> <body>
</Body>