Hello everyone, Could someone please help me with an Html and CSS issue. I am using asp.net c#.
I am stuck in how to create an array of buttons in HTML.

I do know how to create 1 button but I need to create about 10-12 buttons.

Would like to know how to declare an array.

Thank you

You may try this

  void CreateBtnArr()
{
  int x;
  if (!Page.IsPostBack)
           {
          for (x = 1; x <= 12; x++ )
          {

            Button btnArr = new 
   Button();
             btnArr.ID = "mybtn" + x;
             btnArr.Text = "Button " + x;
               btnArr.Width = "130px";
      btnArr.Height = "50px";

this.Form.Controls.Add(btnArr);

          }
         }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.