Hi
I want if rb1 is clicked then its BackGround Color should be Green.
If rb2 is clicked then its BackGround Color should be Red.
Code
Hi
I want if rb1 is clicked then its BackGround Color should be Green.
If rb2 is clicked then its BackGround Color should be Red.
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 attend4days leftRegister
Abhishek ChadhaRank #402 · 6.2K reputationPosted Sep 21, 2022, 1:49 PM EDT
protected void options_CheckedChanged(Object sender, EventArgs e) { if (rb1.Checked) { //set background color green } if (rb2.Checked) { //set background color red } }Jignesh KumarRank #91 · 22.9K reputationPosted Sep 22, 2022, 12:19 AM EDT
Hi Ramco,
Please use this one to change background color of radio button,
Code Behind File generate event for check change event,
protected void options_CheckedChanged(Object sender, EventArgs e) { if (rb1.Checked) { rb1.BackColor = Color.Green; } if (rb2.Checked) { rb2.BackColor = Color.Red; } }