Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Concatenate field values

Reply
Thread Tools

Concatenate field values

 
 
TJHerman
Guest
Posts: n/a
 
      06-13-2006
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?
 
Reply With Quote
 
 
 
 
digitaljeebus@gmail.com
Guest
Posts: n/a
 
      06-13-2006
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?


 
Reply With Quote
 
 
 
 
TJHerman
Guest
Posts: n/a
 
      06-13-2006
Thanks so much!

"(E-Mail Removed)" 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?

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenate/De-Concatenate Carlos VHDL 10 10-24-2012 01:04 PM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
concatenate text with a bound value in a gridview field smccauslin@comcast.net ASP .Net 2 09-12-2006 02:51 AM
How to concatenate two integer values priya C++ 30 05-27-2005 05:46 AM
concatenate in Javascript function? simple field validation funciton not working - needs to concat field name with object NotGiven Javascript 7 07-24-2003 11:44 AM



Advertisments