How to Cast DotNet Labels as Text in VB?

I'm going crazy here trying to figure out how to send a label item from a dotnet form to email. I have no problems sending dropdownlist items or textbox items, but I can't seem to hit the syntax for a label.

The labels are displayed on my form based on the ID of the logged in user, in a DetailsView named LoggedInUser. Both of these statements display the Phone number:

<li>PHONE <font color="red"><%#Container.DataItem("PHONE")%></font> </li>
<li><asp:Label ID="LblPhone" runat="server"><%#Eval("PHONE")%></asp:Label> </li>

I've tried every variation of this statement that I can think of:

Dim phonenum = CType(LoggedInUser.FindControl("LblPhone"), Label).Text.ToString()

including Ctype, TryCast, DirectCast...and my resulting email is empty. So this iteration of my attempt doesn't throw an error, but doesn't produce a result either. Here's the line from my email formatting, if it helps:

sb2.AppendFormat(String.Format("<td bgcolor='#FFFFDD'>{0}", phonenum))

Thanks!
davewalter1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Paul JacksonSoftware EngineerCommented:
Change your labels to use the Text property in the markup as shown below :

<asp:Label ID="LblPhone" runat="server" Text='<%#Eval("PHONE")%>'></asp:Label>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
davewalter1Author Commented:
Beautiful! You are the man, Jacko. Thank you very much!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.