| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Simple If/Then statement in C#
Simple If/Then statement in C#
<%@ Page Language="C#" %> <script runat="server"> void button1_Click(Object sender, EventArgs e) { if (textbox1.Text == "ASPFree.com") { Literal1.Text = "Textbox Condition was <b>True</b>"; } else { Literal1.Text = "Textbox Condition was <b>False</b>"; } } </script> <html> <head> </head> <body> <h2 align="center">Simple If/Then statement in C# </h2> <p align="left"> This is simple if/then statement to help get started learning C#. </p> <form runat="server"> <i>If you type in <b>ASPFree.com</b>, that is the condition</i> <br /> Fill something in:<asp:textbox id="textbox1" runat="server" value="ASPFree.com"></asp:textbox> <br /> <br /> <asp:button id="button1" onclick="button1_Click" runat="server" text="Click me"></asp:button> <br /> <br /> <br /> <asp:Literal id="Literal1" runat="server"></asp:Literal> </form> </body> </html> Read the Article |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Simple If/Then statement in C# |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|