1.File-> New-> Website-> ASP.NET Web Site(Visual C#) -> Ok
(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)
2.ToolBox-> Double Click on Label(or drag and drop Label on Design view)-> Right click on Label->Select Properties->change Text properties to Select your Gender?
3. ToolBox-> Double Click on RadioButton->Right click on RadioButton->Select properties->Change text properties to Male->AutoPostBack properties to True->GroupName properties to RadioButtonControl
ToolBox-> Double Click on RadioButton->Right click on RadioButton->Select properties->Change text properties to Female->AutoPostBack properties to True->GroupName properties to RadioButtonControl
4.ToolBox-> Double Click on Label-> Right click on Label->Select Properties->change Text properties to
Blank(delete the label text so when you run nothing will show)
Your Design window should look like this
5.Right click on Male RadioButton(RadioButton1)->properties->Click Events->Double click on CheckedChanged events(to get the code behind)
And write this code:
6..Right click on Female RadioButton(RadioButton2)->properties->Click Events->on CheckedChanged events DropDownList select RadioButton_CheckedChanged(it is the event name which we created on our first RadioButton's CheckedChanged Event)
7.Click F5 to run your project.
(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)
2.ToolBox-> Double Click on Label(or drag and drop Label on Design view)-> Right click on Label->Select Properties->change Text properties to Select your Gender?
3. ToolBox-> Double Click on RadioButton->Right click on RadioButton->Select properties->Change text properties to Male->AutoPostBack properties to True->GroupName properties to RadioButtonControl
ToolBox-> Double Click on RadioButton->Right click on RadioButton->Select properties->Change text properties to Female->AutoPostBack properties to True->GroupName properties to RadioButtonControl
4.ToolBox-> Double Click on Label-> Right click on Label->Select Properties->change Text properties to
Blank(delete the label text so when you run nothing will show)
Your Design window should look like this
5.Right click on Male RadioButton(RadioButton1)->properties->Click Events->Double click on CheckedChanged events(to get the code behind)
And write this code:
6..Right click on Female RadioButton(RadioButton2)->properties->Click Events->on CheckedChanged events DropDownList select RadioButton_CheckedChanged(it is the event name which we created on our first RadioButton's CheckedChanged Event)
7.Click F5 to run your project.
After Running the project |
After clicking Male RadioButton |
After Clicking Female RadioButton |
No comments:
Post a Comment