Total Page Preview: 000000001177
What is dropdown in ASP.NET in English and Hindi
Dropdown in ASP.NET in English
In ASP.NET, a dropdown list is a user interface control that allows the user to select a single value from a list of predefined options. This control is commonly used to provide users with a set of choices in a clear and organized way.
Here's an example of how to use a dropdown list control in ASP.NET:
In the example above, we have a dropdown list (ddlColors) that allows the user to select a color. The list contains three items, each with a text label and a value. The ListItem control is used to define each item in the list. The "Text" attribute specifies the text label that will be displayed to the user, while the "Value" attribute specifies the value that will be returned when the user selects the item.
When the user selects an item from the dropdown list and submits the form, the value of the selected item will be sent to the server. In ASP.NET, you can access the selected value using the SelectedValue property of the DropDownList control:
You can also use the SelectedIndex property to get the index of the selected item in the list:
The dropdown list control in ASP.NET provides various properties and events that allow you to customize its appearance and behavior, such as the AutoPostBack property that determines whether the page is posted back to the server when an item is selected, or the SelectedIndexChanged event that is raised when the selected item in the list changes.
Dropdown in ASP.NET in Hindi
ASP.NET mai, Dropdown List ek user interface control hota hai jiski madad se user ek predefined options ki list se single value ko select kar sakta hai. Ye control commonly used hota hai users ko set of choices provide karne k liye in a clear and organized way.
Yaha ek example hai dropdown list control ka kaise use kiya jata hai ASP.NET mai:
Example mai, hum dropdown list (ddlColors) ko dikhaya hai jo user ko ek color select karne ki ijazat deta hai. List teen items se bani hai, har item ko text label or value di gayi hai. ListItem control har item ko define karta hai. "Text" attribute har item ka text label define karta hai jo user k liye display hota hai, "Value" attribute har item ki value define karta hai jo user select karta hai.
Jab user dropdown list se ek item select karta hai or form submit karta hai, tab selected item ki value server par sent hoti hai. ASP.NET mai, aap DropDownList control ki SelectedValue property ka use karke selected value ko access kar sakte hai:
Aap SelectedIndex property ka bhi use karke selected item ki index ko access kar sakte hai:
Dropdown list control mai various properties or events available hai jiski madad se aap uski appearance or behavior ko customize kar sakte hai, jaise AutoPostBack property joki determine karta hai ki jab koi item select kiya jaye to page ko server par post karna hai ya nahi, ya SelectedIndexChanged event jo tab raise hota hai jab dropdown list mai koi item select hota 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