Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
what control is used for storing true false in asp.net.pls guide me.
Posted
Comments
[no name] 19-Jul-12 7:54am    
You obviously need to look into getting a basic book on programming instead of spamming the message board trying to get people to teach you programming one question at a time.

ASP.NET
<asp:checkbox />


Your form:
HTML
<asp:CheckBox runat="server" id="myCheckBox"/>
<asp:Button runat="server" value="Submit" id="btnSubmit" OnClick="btnSubmit_Click"/>

Code behind:
C#
protected void btnSubmit_Click(object sender, EventArgs e)
{
    var checkboxValue = myCheckBox.Checked; // gives boolean value. true/false
}


http://msdn.microsoft.com/en-us/library/4s78d0k1(v=vs.71).aspx[^]
 
Share this answer
 
v4
Comments
Espen Harlinn 19-Jul-12 9:25am    
5'ed!
StianSandberg 19-Jul-12 10:14am    
Takk Espen :)
Generally, checkbox is used for boolean field.

See: MSDN: Checkbox[^]
 
Share this answer
 
Comments
Espen Harlinn 19-Jul-12 9:25am    
5'ed!
Sandeep Mewara 19-Jul-12 9:38am    
Thanks Espen.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900