Total Page Preview:   000000000345

What is radio button in ASP.NET in English and Hindi

 

Radio button in ASP.NET in English

In ASP.NET, a RadioButton is a web control that allows users to select one option from a group of options. When a user selects a RadioButton, all other options in the group are automatically deselected.

Here is an example of how to use RadioButton in ASP.NET:

 
In this example, a RadioButtonList control is used to create a group of RadioButtons. Each RadioButton in the group is represented by an ASP.NET ListItem control, and the value of each ListItem is set to the programming language it represents.
To retrieve the selected value of the RadioButton group, you can use the following code in the code-behind:
 
 
This code retrieves the selected value of the RadioButton group and writes it to the page.
Note that you can also use individual RadioButton controls to create a group of RadioButtons, but in that case, you will need to use the GroupName property to ensure that only one RadioButton can be selected at a time.
Here is an example of using individual RadioButtons:
 
In this case, the GroupName property is set to "programmingLanguages" to ensure that only one RadioButton can be selected at a time.
 
 
Radio button in ASP.NET in Hindi
ASP.NET mein, RadioButton ek web control hota hai jisse ek se zyada options ke beech mein se ek option select kiya ja sakta hai. RadioButton ka use forms mein input lene ke liye, jaise ki "Yes/No", "Male/Female", "Agree/Disagree" etc, ki tarah ki situations mein kiya jaata hai.
Yahan ek example diya ja raha hai jisme RadioButton control ka use kiya gaya hai:
 
 
Is example mein, 3 RadioButtons diye gaye hai jo ek group mein hain. Har RadioButton control ka unique ID hota hai, jisse code-behind se unhe identify kiya ja sakta hai. GroupName property ke through, ye RadioButton controls ko ek group mein organize kiya gaya hai.
 
RadioButton ka value code-behind mein retrieve karne ke liye, "SelectedValue" property ka use kiya jaata hai. Yahan ek example diya ja raha hai, jisme RadioButton ka value retrieve karne ke baad uska message display kiya ja raha hai:
 
 
Is code-behind example mein, "Request.Form" property se selected RadioButton ka value retrieve kiya ja raha hai. Agar koi RadioButton select nahi kiya gaya hai, toh "Please select a color" message display kiya jaayega.

 

 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments


                           
                           

                           

                           

Facebook User: