I am trying to create a drop down menu in an ASP.NET using a text file as the list elements. I want to create the menu from the text file so I can easily add or delete different options without adding the ASP.NET source code. Also, how could I store new options as variables in ASP.NET when more options are added to the text file? My code-behind is c#.
Thanks all,
Stephen
I am trying to create a drop down menu in an ASP.NET using a
Share
If you haven’t actually created the text file yet, I would suggest creating an XML text file for this, then using LINQ to XML to pull the values out, and bind them to your dropdown.
Search on those keywords to find the details on how to do those things.
your XML file might look like this:
Then query the data like this:
Then bind to your drop down: