Manipulate asp:label through ul/li

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jan 2008
Posts: 29
Reputation: J'Tok is an unknown quantity at this point 
Solved Threads: 0
J'Tok's Avatar
J'Tok J'Tok is offline Offline
Light Poster

Manipulate asp:label through ul/li

 
0
  #1
Apr 17th, 2009
I am using Visual Studio 2008 developing a web app front-end for a T-SQL DB using asp.net and vb.net.

I have a label inside a list like so:

  1. <ul id="ul" class="class">
  2. <li id="li">
  3. <asp:Label runat="server" ID="label"></asp:Label>
  4. </li>
  5. </ul>

I cannot access the label directly in my code-behind file like I normally would. (Ex. label.text = "Something")

I'm assuming I need to use FindControl in some way, but I'm obviously having no success.

I guess that means my question is: How can I expose the label control so I can manipulate it with vb?

Thank you,
J'Tok
Last edited by J'Tok; Apr 17th, 2009 at 1:49 pm. Reason: Forgot code tags, and had minor spelling error.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 115
Reputation: ninjaimp is an unknown quantity at this point 
Solved Threads: 6
ninjaimp ninjaimp is offline Offline
Junior Poster

Re: Manipulate asp:label through ul/li

 
1
  #2
Apr 17th, 2009
in code, say the page_load event you could do:

  1. me.label.text = "Test Text"
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 29
Reputation: J'Tok is an unknown quantity at this point 
Solved Threads: 0
J'Tok's Avatar
J'Tok J'Tok is offline Offline
Light Poster

Re: Manipulate asp:label through ul/li

 
1
  #3
Apr 17th, 2009
Thanks ninjaimp! Worked perfectly.

- J'Tok
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC