programming we consider all important topic for knowledge about controls,web Services, JSON, Ajax, database, and interview related Question. In this and sql server tutorial blog we give many examples of jquery as like How Play YouTube Video in Your Website by URL, How to Play YouTube Videos in by using Jquery , Jquery Change div background on mouseover in , JQuery UI Datepicker (Calendar) etc.

Friday, August 22, 2014

How to check If checkbox Is checked in

 Check If checkbox is checked in using C#:

CheckBox is an asp.netweb server control present in .net platform. Checkbox control allow  to user (web site visitor) to check (select) a particular item on page as like  true or false condition.  so the checkbox control create a square box on web page  that allow user to switch between a true or false condition. In this tutorial we also provide many post related to check box like "how to use check box with in gridview control in" and how to use check box in gridview header Example and "how to check validation of checkbox control" and using checkbox in example.

.  Html CheckBox controls using jQuery

Checkbox control  properties:

the checkbox control has many properties that gives to facility to user  to change style such as BackColor, BorderColor,BorderStyle, CssClass, BorderWidth, EnableTheming,  SkinID, Font, Width,Height, ForeColor, ToolTip,etc.

Check If checkbox is checked:

if we want to determine whether checkbox is selected then we need to use the checkbox Checked property.  checkbox AutoPostBack property value true enable automatic refers the web page when developers can write an event handler for CheckedChanged event.

Example of checkbox.aspx page code in :

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Exampleofcheckbox.aspx.cs" Inherits="Exampleofcheckbox" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
    <div align="center">
    <h1> Example of Checkbox in</h1>
        <asp:CheckBox ID="CheckBox1" runat="server" Font-Size="Large"
            Text="Select this " />
        <br />
        <br />
        <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label>
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Font-Bold="True" Font-Size="Large"
            Height="41px" onclick="Button1_Click" Text="Submite" Width="94px" />
checkbox Is checked in
Checkbox Is checked in

Checkbox.aspx page C# code in :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Exampleofcheckbox : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)

    protected void Button1_Click(object sender, EventArgs e)
        if (CheckBox1.Checked == true)
            Label1.Text = "check box selected.";
            Label1.Text = "check box not selected.";

Other web controls related Post:

No comments:

Post a Comment