How to checked RadioButton Control when Page Load in asp.net

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

ToolBox-> Double Click on RadioButton->Right click on RadioButton->Select properties->Change text properties to Female 
Your Design window should look like this
RadioButton Control Design window















4. Right click on Male RadioButton(RadioButton1)->View code(to get the code behind)
And write this code

5.Click F5 to run your project
RadioButton Control Page Load
 

No comments:

Post a Comment