Button[] mybutton = new Button[6];

        for (int i = 0; i < mybutton .GetLength (0); i++)
        {
            //mybutton[i] = (Button)this.Controls[Class3.buttonid  + (i + 1)];

            Class1.navigate_url(mybutton[i], TextBox1);
        }

the commented line above is not working in system.web.ui unlike system.windows.forms......
why????
and wt to do now....please help me out with it....thnks for ur kind attention....

Recommended Answers

All 2 Replies

insert a breakpoint and debug to check what controls are present in this.Controls

You have in fact declared an array of 6 button objects.
But you still have to allocate each button!
Use: mybutton = new Button();

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.