I have an array of strings, which will be placed into the text of a button, it is shuffling the array correctly but when it comes to placing the text inside of the button it is replacing them all with the same value and has no way of knownig whether the value has already been used or no t, I'm guessing this is down to the loops being in the wrong position or something of that nature.
protected void Page_Load(object sender, EventArgs e)
{
string[] arr = new string[]
{
"0","1","2","3","4","5","6","7","8","9"
};
//shuffle code
string[] shuffle = RandomStringArrayTool.RandomizeStrings(arr);
foreach (string s in shuffle)
{
foreach (var item in panel1.Controls)
{
if (item is Button)
{
((Button)item).Text = s.ToString();
}
}
}
}