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
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hemant KumarPosted Sep 22, 2011, 6:24 AM
Please find the attachment.
Prabhu RajaPosted Sep 22, 2011, 5:19 AM
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
Jaganathan BantheswaranPosted Sep 22, 2011, 4:48 AM
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