Home All Groups Group Topic Archive Search About
Author
13 Jun 2006 7:41 PM
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?

Author
13 Jun 2006 7:48 PM
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!
TJHerman wrote:
Show quoteHide quote
> 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?
Author
13 Jun 2006 8:08 PM
TJHerman
Thanks so much!

Show quoteHide quote
"digitaljee***@gmail.com" wrote:

> 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!
> TJHerman wrote:
> > 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?
>
>