ASP.NET If Else

Conditional Stements are used when we want to perform an action based on a condition. For instance, we can say it its rainting stay at home else lets go out. Example is below
One Condition:

If  condition Then

    Execution…

End If

Two Conditions:

If  condition Then

    Execution…

Else

    Execution…

End If

Note: else will always mean the opposite to if

More than Two Conditions:

If  condition Then

    Execution…

Else If condition Then

    Execution…

Else

    Execution…

End If

 

<%
            Dim age as integer = 25
           
            if age = 25
                        response.Write(“value of age is 25”)
            else
                        response.Write(“Do you know the value of age?”)
            end if
           
%>