Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically obtaining a reference to Buttons (C#)
Message
From
27/05/2004 14:03:16
 
 
To
27/05/2004 13:53:14
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00907871
Message ID:
00907879
Views:
6
Hi Claudio,

Thanx for all of the articles regarding vfp -vs- .net. Great stuff. How about some data basics for all of us using free fpw2.6 tables with the vfpoledb provider. Anyway... I found that this works great.
Button oButton
oButton = (Button)this.FindControl("btn" + btncnt.ToStirng());
oButton.Text = btncnt.ToString();
Neil

>Hi Neil,
>
>there's a Controls member in the page. I imagine you can iterate through it (foreach) and check for the control's type... if it's a button, you cast it to a button, and do what must be done. Did that make sense?? :)
>
>
>>I have 3 Buttons on a web form, btn1, btn2 and btn3. I would like to loop thru a for-loop and set the Text property for each, namely 1, 2 and 3 respectively. Can someone please suggest a way to do it. I don't know how to get a reference to each button programmatically.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform