Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Sep 10, 2012, 10:01 PM EDT
selvi subramanianRank #2,007 · 723 reputationPosted Sep 10, 2012, 10:04 PM EDT
have to select a single field using asp.net c#
selvi subramanianRank #2,007 · 723 reputationPosted Sep 10, 2012, 10:10 PM EDT
Sukesh MarlaRank #461 · 5.4K reputationPosted Sep 10, 2012, 10:15 PM EDT
Check this is correct answer if it helped.
selvi subramanianRank #2,007 · 723 reputationPosted Sep 10, 2012, 10:18 PM EDT
Satyapriya NayakRank #47 · 31.5K reputationPosted Sep 10, 2012, 10:19 PM EDT
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 subramanianRank #2,007 · 723 reputationPosted Sep 10, 2012, 10:49 PM EDT
Abhimanyu K VatsaRank #14 · 51.7K reputationPosted Sep 11, 2012, 7:09 AM EDT
On ASPX Page
Hope this helps.
selvi subramanianRank #2,007 · 723 reputationPosted Sep 12, 2012, 8:46 PM EDT