Radio Button Examples in asp.net

Radio Button Examples in asp.net

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;



public partialclass RadioButtonPrograms: System.Web.UI.Page

{

    protectedvoid Page_Load(objectsender, EventArgs e)

    {

        RadioButton1.AutoPostBack = true;

        RadioButton2.AutoPostBack = true;


        Label1.Text = "";


        if(RadioButton1.Checked)

        {

            Label1.Text = "Your gender is " + RadioButton1.Text;

        }

        else

        {

            Label1.Text = "Your gender is " + RadioButton2.Text;

        }

        }

}


Note:-  Set GroupName Properties - "gender" both Radio Button








Comments

Popular posts from this blog

Creating a DDL File & link ddl file in C#

SQL Command in asp.net