Solved

Would like to Concatenate string value with '<%#Eval("Remaining_Seats")%>' to form the text of an asp.Table cell

Posted on 2008-06-13
6
2,530 Views
Last Modified: 2008-07-02
I would like to concatenate string value of "Number Remaining:" with '<%#Eval("Remaining_Seats")%>' to form the text of an asp.Table cell.

Any ideas?
0
Comment
Question by:DanGettel
  • 3
  • 2
6 Comments
 
LVL 3

Assisted Solution

by:nds_rahulmistry
nds_rahulmistry earned 100 total points
ID: 21784092

Simply type

"Number Remaining : " & <%#Eval("Remaining_Seats")%>
0
 

Author Comment

by:DanGettel
ID: 21784948
Sorry, but it didn't work when I typed

"Number Remaining : " & <%#Eval("Remaining_Seats")%>
That gave me (Parser Error  The server tag was not well formed.) error message.

Any other ideas

0
 
LVL 65

Assisted Solution

by:RobSampson
RobSampson earned 400 total points
ID: 21788256
Hi, would you be able to use:

<td>Number Remaining:<%#Eval("Remaining_Seats")%></td>

or maybe

<td>Number Remaining:<%Eval('Remaining_Seats')%></td>

or, assuming "Remaining_Seats" was the name of a variable that was already assigned a value in ASP, maybe

<td>Number Remaining:<%Remaining_Seats%></td>

Regards,

Rob.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:DanGettel
ID: 21788942
Sorry,  but I still can't get things to work.

Here is an example of an asp:Table cell that successfully displays the Remainind_Seats value:

<asp:TableCell ID="TableCell2" runat="server" ColumnSpan="2" VerticalAlign="Top" Text ='<%#Eval("Remaining_Seats")%>'>
</asp:TableCell>

Here is an example of an asp:Table cell that successfully displays "Number Remaining:"

<asp:TableCell ID="TableCell1" runat="server" Text='<strong>Number Remaining:&nbsp;&nbsp;</strong>'>
</asp:TableCell>

So what I am really trying to do is combine the two into one cell.

0
 
LVL 65

Assisted Solution

by:RobSampson
RobSampson earned 400 total points
ID: 21789740
Hmmm, in that case, by all accounts, this should work.....in theory.....

<asp:TableCell ID="TableCell1" runat="server" Text='<strong>Number Remaining:&nbsp;&nbsp;<%#Eval("Remaining_Seats")%></strong>'>
</asp:TableCell>

Regards,

Rob.
0
 

Accepted Solution

by:
DanGettel earned 0 total points
ID: 21856295
The following is the only way that I have found to get the cell to appear the way I intended:

<asp:TableCell ID="TableCell11" runat="server" ColumnSpan="2">
    <strong>Remaining Seats:&nbsp;&nbsp;</strong>
    <asp:Label ID="Label1" runat="server" Text='<%# Eval("Remaining_Seats") %>'></asp:Label>
</asp:TableCell>
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question