Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 3rd, 2004, 10:04 AM
MickeyA MickeyA is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Chattanooga, TN
Posts: 2 MickeyA User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How to construct the control name of a Label on a web form at runtime

I want to access forty Label controls in a table on my web page by using a Do Loop (or whatever) to access each Label control in sequence. I know the Label control names are Label1...Label40. How can I 'construct' the Label control name at runtime?

Dim intX, intEnd as Integer
Dim strLabelName As String
intX = 1
intEnd = 40
Do Until intX > intEnd
' contruct Label name
strLabelName = "Label" & Trim(CStr(intX))

strLabelName.Text = "whatever"
intX += 1
Loop

I realize that referring to the .Text using strLabelName won't work, but I don't know how to turn that StrLabelName into the ID (or whatever) for a Label control on the web form.

HELP !!! (and thanks a bunch)

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > How to construct the control name of a Label on a web form at runtime


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT