C#
if (!IsPostBack)
{
List countries = GetCountries();
// Add "Select" as the first item in the list
countries.Insert(0, new Country { Id = 0, Name = "Select" });
ddlCountries.DataSource = countries;
ddlCountries.DataBind();
}
}
private List GetCountries()
{
// Code to retrieve the list of countries from the database
// and return it as a List
// Replace this with your actual data retrieval logic
List countries = new List
Vishal YelveRank #178 · 13.6K reputationPosted May 24, 2023, 11:47 PM EDT
Hi Vamsi,
What help you need??
Janarthanan SRank #224 · 11K reputationPosted May 25, 2023, 9:37 AM EDT
Hi Vamsi,
May I know what type of help and support need and the code is incomplete.
Mohamed Azarudeen ZRank #297 · 8.5K reputationPosted May 24, 2023, 1:38 PM EDT
Hi vamsi what do u need help with and i think the code is not complete
Vamsi132 reputationPosted May 24, 2023, 2:18 PM EDT
thanks i got it resolved already, thankx for trying