I am using asp.net with c#.
I have a dropdown. each item in dropdown has six characters(AUDUSE,USDASD etc.). i want that when user select any item in the dropdown so three characters are assigned to one string and three to other(string a=AUD,string b=USE etc). how is it possible.
Loading
Blocked AccountPosted Jul 26, 2011, 7:56 AM
If the length is fix as you said in your post.
Then you can try this for a quick solution.
protected void DropDownListNumber_SelectedIndexChanged(object sender, EventArgs e)
{
string a = DropDownListNumber.SelectedItem.Text.Substring(0,3);
string b = DropDownListNumber.SelectedItem.Text.Substring(3, 3);
}
Zoran HorvatPosted Jul 26, 2011, 7:54 AM
stirng a = tmp.Substring(0, 3);
string b = tmp.Substring(3);