Question for ASP / ASP.NET Developers

I have a label in a repeater (in itemtemplate). The label’s text property is set as

Text=‘<%# Eval(“newUsed”)%>’
Now I need to basically set the text property to be a concatenated string of 3 fields from the datatable that is binded to the repeater. That line of code above is only pulling the data from the ‘newUsed’ field.

What i want instead is for it to be a concatenation in the format

newUsed Make Model

so i need the fields ‘newUsed’, ‘Make’ and ‘Model’ concatenated in there. Using multiple labels is not an option so somehow i need to make the text property accept that. How do i do it ?

I tried the following but they donot work

Text=‘<%# Eval(“newUsed” + “Make” + “Model”)%>’
Text=‘<%# Eval(“newUsed”) + Eval(“newUsed”)%>’
Text=“‘<%# Eval(“newUsed”)’ + ‘Eval(“newUsed”)%>’”
Any help will be appreciated :slight_smile: Pardon my newbiness.

Re: Question for ASP / ASP.NET Developers

Try & for concatenation.

Re: Question for ASP / ASP.NET Developers

i have. Does not work. I found a workaround however.

Re: Question for ASP / ASP.NET Developers

The problem is that you're using single quotes. Single quotes in ASP/ASP.NET are used for commenting.

Re: Question for ASP / ASP.NET Developers

^^ dont work that way. Apparently there is no workaround, i had to write some customcode in the codebehind to make it behave like i needed it to.