how to select a single field in checkbox using asp.net using c# with example code
how to select a single field in checkbox using asp.net using c# with example code
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
selvi subramanianPosted Sep 13, 2012, 12:46 AM
Abhimanyu K VatsaPosted Sep 11, 2012, 11:09 AM
On ASPX Page
Hope this helps.
selvi subramanianPosted Sep 11, 2012, 2:49 AM
Satyapriya NayakPosted Sep 11, 2012, 2:19 AM
Try this...
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace Country_state
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
if (CheckBox1.Checked == true)
{
Response.Write("you have selected bba");
}
else if (CheckBox2.Checked == true)
{
Response.Write("you have selected bca");
}
else if (CheckBox3.Checked == true)
{
Response.Write("you have selected bcom");
}
else
{
Response.Write("you have selected bsc");
}
clear();
}
void clear()
{
CheckBox1.Checked = false;
CheckBox2.Checked = false;
CheckBox3.Checked = false;
CheckBox4.Checked = false;
}
}
}
Thanks
If this post helps you mark it as answer
selvi subramanianPosted Sep 11, 2012, 2:18 AM
Sukesh MarlaPosted Sep 11, 2012, 2:15 AM
Check this is correct answer if it helped.
selvi subramanianPosted Sep 11, 2012, 2:10 AM
selvi subramanianPosted Sep 11, 2012, 2:04 AM
have to select a single field using asp.net c#
Satyapriya NayakPosted Sep 11, 2012, 2:01 AM