<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="CheckBoxTest" %>
Check Box Test
File: Default.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class CheckBoxTest : System.Web.UI.Page
{
protected void CheckChanged(object sender, System.EventArgs e)
{
if (chkDelivery.Checked)
{
txtAddress.Visible = true;
labAddress.Visible = true;
}
else
{
txtAddress.Visible = false;
labAddress.Visible = false;
}
}
protected void btnOrder_Click(object sender, EventArgs e)
{
labMessage.Text = "Pizza Order Styles:
";
if (chkThin.Checked)
labMessage.Text += chkThin.Text + "
"; ;
if (chkExtra.Checked)
labMessage.Text += chkExtra.Text + "
"; ;
}
}