Concatenate field values

T

TJHerman

I'm sure this is ridiculously simple, but I'm new to this.

I'm trying to combine the values of three variables dimensioned as labels
into a single label variable.

My statement reads like this:

sName = autoNum & " - " & projnum & " - " & lblPropTitle

The error statement says:
"Operator '&' is not defined for types 'System.Web.UI.WebControls.Label' and
'String'."

Can someone tell me what I'm doing wrong?
 
D

digitaljeebus

hehe, welcome to asp.net =) i'm assuming you're using vb.net and trying
to concatenate the text that the label contains right? lblPropTitle is
(probably) a Label, so you need to use lblPropTitle.Text to get at the
input text ... ditto for the other two

assuming they are all labels, you want:
sName = autoNum.Text & " - " & projnum.Text & " - " & lblPropTitle.Text

let us know if that works!
 
T

TJHerman

Thanks so much!

hehe, welcome to asp.net =) i'm assuming you're using vb.net and trying
to concatenate the text that the label contains right? lblPropTitle is
(probably) a Label, so you need to use lblPropTitle.Text to get at the
input text ... ditto for the other two

assuming they are all labels, you want:
sName = autoNum.Text & " - " & projnum.Text & " - " & lblPropTitle.Text

let us know if that works!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top