Total Page Preview: 000000000868
What is checkbox in ASP.NET in English and Hindi
Checkbox in ASP.NET in English
A checkbox is a graphical user interface control element that allows the user to select or deselect an option. In ASP.NET, a checkbox control can be used to get boolean input from the user. When the checkbox is checked, it returns "true" and when it is unchecked, it returns "false".
Here is an example of how to use a checkbox control in ASP.NET using C#:
1-First, add a Checkbox control to your ASP.NET web form. You can do this either by dragging and dropping a Checkbox control from the toolbox onto the design surface, or by adding the following code to your .aspx file:
2-In your C# code-behind file, you can access the value of the checkbox by using the Checked property. For example:
In this example, we have a button on the web form, and when it is clicked, we check whether the checkbox is checked or not. If it is checked, we execute some code, and if it is not checked, we execute some other code.
That's it! This is a basic example of how to use a checkbox control in ASP.NET using C#. You can customize the appearance and behavior of the checkbox control using various properties, events, and styles.
Checkbox in ASP.NET in Hindi
Checkbox ASP.NET mai ek graphical user interface control element hota hai jis se user kisi option ko select ya deselect kar sakta hai. ASP.NET mai Checkbox control boolean input lene ke liye use kiya jata hai. Jab Checkbox check kiya jata hai, to wo "true" return karta hai aur jab wo unchecked hota hai, to wo "false" return karta hai.
Yaha ek example diya gaya hai ki kaise hum Checkbox control ko ASP.NET mai C# ke sath use kar sakte hai:
1-Sabse pehle, apne ASP.NET web form mai ek Checkbox control ko add karein. Aap ise ya to toolbox se Checkbox control ko drag and drop karke design surface pe add kar sakte hai ya phir apne .aspx file mai ye code add karke bhi kar sakte hai:
2-Aap apne C# code-behind file mai Checkbox ki value ko Checked property ka use karke access kar sakte hai. Jaise ki is example mai:
Is example mai, humare web form mai ek button hai, aur jab wo click kiya jata hai, hum check karte hai ki Checkbox checked hai ya nahi. Agar wo checked hai, to hum kuch code execute karte hai, aur agar wo unchecked hai, to hum kuch aur code execute karte hai.
Ye ek basic example hai ki kaise hum Checkbox control ko ASP.NET mai C# ke sath use kar sakte hai. Aap Checkbox control ke appearance aur behavior ko various properties, events, aur styles ka use karke customize kar sakte hai.
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