User Name Password Register
DaniWeb IT Discussion Community
All
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,521 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,802 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: 2013 | Replies: 3 | Solved
Reply
Join Date: Sep 2007
Posts: 1,058
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Accessing Label inside Repeater

  #1  
Oct 3rd, 2007
I have retrieved a value from a query and need to put it into the Label called "lblViews". Every way I try, it says there is no instance for this object. How do I write/set the text of the label to the query I retrieved in the Page_Load method? Thanks.

I have tried the following:
----
Dim Control1 As Label = Ctype(CelebBio.FindControl("lblViews"), Label)
lblViews.Text = Views
----
CelebBio.lblViews.Text = Views
----

'Views does exist, and writes normally just not to the label inside the repeater. I would hate to have a hidden label outside the repeater and on onLoad set javascript to set the label equal to the hidden label.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2006
Location: Bellevue, WA
Posts: 1,548
Reputation: Infarction has a spectacular aura about Infarction has a spectacular aura about Infarction has a spectacular aura about 
Rep Power: 8
Solved Threads: 51
Sponsor
Infarction's Avatar
Infarction Infarction is offline Offline
Battle Programmer

Re: Accessing Label inside Repeater

  #2  
Oct 3rd, 2007
I think you might have to do something about taking the repeater and finding the label in its children or something... I had a problem like this once, but I don't quite remember what I did...
Reply With Quote  
Join Date: Sep 2007
Posts: 1,058
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Accessing Label inside Repeater

  #3  
Oct 3rd, 2007
Yeah, that's the part I cannot figure out. It's all done on page_load not in a vb file. Just need to figure out what I need to put. Everything that made sense to me does not work! Thanks though.
Reply With Quote  
Join Date: Sep 2007
Posts: 1,058
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Accessing Label inside Repeater

  #4  
Oct 4th, 2007
I solved this one myself. All I did was make the DataList query two tables and used the value there. If you have questions, PM me and I'll tell you how!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 4:13 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC