filmov
tv
radio button in asp.net | asp.net control - part-4

Показать описание
what is radio button?
It is an input control which is used to takes input from the user.
It allows user to select a choice from the group of choices.
Properties :
GroupName : It is used to set name of the radio button group.
Text : It is used to set text to be shown for the control.
ToolTip : It displays the text when mouse is over the control.
Visible : To set visibility of control on the form.
c# code
protected void btnsubmit_Click(object sender, EventArgs e)
{
if(rdbfemale.Checked)
{
lblmsg.Text = "Your gender is " + rdbfemale.Text;
}
if(rdbmale.Checked)
{
lblmsg.Text = "Your gender is " + rdbmale.Text;
}
}
#RadioButton
#informtechi
#asptutorial
It is an input control which is used to takes input from the user.
It allows user to select a choice from the group of choices.
Properties :
GroupName : It is used to set name of the radio button group.
Text : It is used to set text to be shown for the control.
ToolTip : It displays the text when mouse is over the control.
Visible : To set visibility of control on the form.
c# code
protected void btnsubmit_Click(object sender, EventArgs e)
{
if(rdbfemale.Checked)
{
lblmsg.Text = "Your gender is " + rdbfemale.Text;
}
if(rdbmale.Checked)
{
lblmsg.Text = "Your gender is " + rdbmale.Text;
}
}
#RadioButton
#informtechi
#asptutorial