|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Concatenate field valuesI'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? 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? 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? > >
SQLDataSource binding to treeview control when using "FOR XML" on select
back to calling page WebControl with CSS and Javascript Copying A Control Not As A Reference Copy & paste with a command button? how to raise SelectedIndexChange event? sorting in a datagrid checkbox weird Problem Control in template does not bubble events ReportViewer Full Trust Required? |
|||||||||||||||||||||||