-->
<asp:CheckBox ID="chkNewsletter" runat="server" />
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckBoxDemo01.aspx.cs" Inherits="LearnAsp.Net.Control.CheckBox.CheckBoxDemo01" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:CheckBox ID="chkNewsletter" Text="Receive Newsletter?" runat="server" /> <br /> <asp:Button ID="btnSubmit" Text="Submit" OnClick="btnSubmit_Click" runat="server" /> <hr /> <asp:Label ID="lblResult" runat="server" /> </div> </form> </body> </html>
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace LearnAsp.Net.Control.CheckBox { public partial class CheckBoxDemo01 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnSubmit_Click(object sender, EventArgs e) { lblResult.Text = chkNewsletter.Checked.ToString(); } } }
Thanks for reading Asp.Net CheckBox Control
Please do not enter any spam link in the comment box.
No comments:
Post a Comment
Please do not enter any spam link in the comment box.