•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,528 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,741 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 964 | Replies: 7
![]() |
hii,
iam giving an example to display dynamically two labels.hope it is usefull.
if u have already have 5 labels in u r page but u want to display only 2 labels ,then this function is usefull
label1,label2 be u r label ids in the page
dim lbl as string
dim l as label
for 1=0 to 1
lbl="label"& convert.tostring(i)
l=page.findcontrol(lbl)
l.visible=true
next
iam giving an example to display dynamically two labels.hope it is usefull.
if u have already have 5 labels in u r page but u want to display only 2 labels ,then this function is usefull
label1,label2 be u r label ids in the page
dim lbl as string
dim l as label
for 1=0 to 1
lbl="label"& convert.tostring(i)
l=page.findcontrol(lbl)
l.visible=true
next
•
•
Join Date: Sep 2007
Posts: 1,058
Reputation:
Rep Power: 4
Solved Threads: 61
You should not have to find the labels unless they are nested in another control like a datalist, grid, or repeater, etc. Try telling us what you want to do in this loop.
Oh, and the reason why his code isn't working for you is due to a few flaws. The below code is suited for you:
Oh, and the reason why his code isn't working for you is due to a few flaws. The below code is suited for you:
Public Function LoopingTheLbls() Dim i As Integer Dim lbl As Label Dim b As String For i = 0 To 49 b = "q" & Convert.ToString(i + 1) lbl = Page.FindControl(b) lbl.Text = "Help I am control " & (i + 1) next End Function
Last edited by SheSaidImaPregy : Oct 10th, 2007 at 2:51 am.
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net .net framework 3.0 access accounting software selection ajax asp business software code combo core custom data developer development dom dropdownlist erp systems evaluation evaluations fedora feed legacy linux microsoft module msdn net office project project management reader reuse selection skin software software selection software solutions sql technology evaluation theme vista weather web windows workflow xml xoap
- Integrate Microsoft Project 2003 in Microsoft SharePoint 2003 Server (Windows NT / 2000 / XP / 2003)
- Project on offer - GUI for ATi Drivers (Software Development Job Offers)
- Wade Robson Project (Geeks' Lounge)
- ASP .NET web apps/service in VS.NET won't let me name the project? (ASP.NET)
- amateur coders needed , project in audio streaming (C++)
- Group Project Ideas (Geeks' Lounge)
Other Threads in the ASP.NET Forum
- Previous Thread: shopping cart and payment gateway
- Next Thread: Frames in ASP.NET ? Is it possible ?



Linear Mode