Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Simple problem using for loop/array?

  • 15-12-2007 1:05pm
    #1
    Registered Users, Registered Users 2 Posts: 6,535 ✭✭✭


    Hey i was just going over a bit of web programming but i cant get this code to work.

    Its in C# doing a web site. What i have is a button and a text box so when i click the button it will display all values in the array.

    protected void Button1_Click(object sender, EventArgs e)
    {
    int [] vals={10,20,30,40,50};
    for (int i=0;i<6;i++)
    {

    txtBoxDisplay.Text = vals.ToString();
    }
    }
    thats my code but I just cant remember how to get the values to all display beside eachother in the text box when i click the button. What am I doing wrong?


Comments

  • Registered Users, Registered Users 2 Posts: 981 ✭✭✭fasty


    txtBoxDisplay.Text += vals;


Advertisement