Hi
i have 1 Dropdown having list Of Locations . On the basis of selection of Location i want to display in another dropdown list of Offices of that Location from CSV file.
Thanks
DropDown List
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Sep 22, 2011, 12:48 AM EDT
You can know how to read CVS file like,
Using System.IO;
StreamReader sr = new StreamReader(@"file.csv");
// for set encoding
// StreamReader sr = new StreamReader(@"file.csv", Encoding.GetEncoding(1250));
string strline = "";
string[] _values = null;
int x = 0;
while (!sr.EndOfStream)
{
x++;
strline = sr.ReadLine();
_values = strline.Split(';');
if (_values.Length >= 6 && _values[0].Trim().Length>0)
{
MessageBox.show(_values[1]);
}
}
sr.Close();
And you can load the data to dropdown list as like
Change Color of text, control through dropdown list in asp.net
Prabhu RajaRank #861 · 2.6K reputationPosted Sep 22, 2011, 1:19 AM EDT
You can do this by a lot of ways, But a Standard way of doing like this is, using CascadingDropdown. In this Concept,
Each and every Dropdown Values will depends on the Selection of Another Dropdown.
how to Read CSV File, Click Here
I suggest you to see the cascadingDropdown Demonstration, Click Here.
-------------------------------------------------------------------
If this post helps you, then mark as "Correct Answer"
Thank You
Hemant KumarRank #1,202 · 1.5K reputationPosted Sep 22, 2011, 2:24 AM EDT
Please find the attachment.