Help
Hi i need the following one. I am having one drop down list on my aspx page. What i need is i wil save some information in textbox line by line.. When ever a form is loaded it should display all the names in text file. And if any modifications done in the text file it should be updated.

StefanPosted May 26, 2009, 1:07 PM
Dorababu MekaPosted May 26, 2009, 12:39 AM
StefanPosted May 25, 2009, 12:26 PM
You can do this by storing one name per line, and then adding each line to an array:
string[] names = File.ReadAllLines("YouTextFile.txt");
for (int i = 0; i < names.Length; i++)
{
dropDownList.Items.Add(names[i]);
}
Add this code to you form-load event. Change "dropDownList" to the name of your control, and "YouTextFile.txt" to the name of your file.
Hope this helps!