Ask a Question related to ASP.NET General, Design and Development.
-
George Ter-Saakov #1
how to show predefined text instrad of value in Repeater.
Hi. I am trying to show the grid of prices.
But if there is no price I want to show "NA". How can I do that?
Here is the code I am using to display the grid.
<asp:Repeater id=Repeater1 runat="server">
<ItemTemplate>
<tr>
<td width="30%" align="center" nowrap class="btext"><%# ((clsModifier)Container.DataItem).Price.ToString(" $#,##0.00")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
Thanks.
George.
George Ter-Saakov Guest
-
#7741 [Opn->WFx]: [phpdoc] Document about every predefined variable
ID: 7741 Updated by: rasmus@php.net Reported By: tictactux at surfeu dot ch -Status: Open +Status: ... -
predefined variables
could anyone provide information about the following predefined variables of coldfusion:MM_redirectLoginSuccess and MM_redirectLoginFailed..... ... -
Add formatted text to JavaScript function call during ItemDataBound of a Repeater Control.
Hello, I am taking values from a datatable and formatting them for use in a JavaScript Function Call. The end result is a mouse over tool tip. ... -
Actionscript 2.0: Adding functions to predefined classes?
I'm currently attempting to bring an extremely large project from Acitonscript 1.0 to Actionscript 2.0. One of the (many) stumbling blocks along the... -
Text values within a Repeater
Hi, I have a repeater, and on post-back when I try to access the Text properties of <asp:label>'s in the repeater, they are all String.Empty (which... -
Ken Cox [Microsoft MVP] #2
Re: how to show predefined text instrad of value in Repeater.
Hi George,
How about inserting an IIF in there as you evaluate the item?
<table>
<asp:repeater id=Repeater1 runat="server">
<itemtemplate>
<tr>
<td width="30%" align="center" nowrap ><%#
iif(DataBinder.Eval(Container.DataItem, "UnitPrice")=0,"NA",
format(DataBinder.Eval(Container.DataItem, "UnitPrice"),"$#,##0.00") )%>
</td>
</tr>
</itemtemplate>
</asp:repeater> </table>
Does this help?
Ken
MVP [ASP.NET]
"George Ter-Saakov" <we@hotmail.com> wrote in message
news:ej4eWK7TDHA.2420@TK2MSFTNGP10.phx.gbl...
Hi. I am trying to show the grid of prices.
But if there is no price I want to show "NA". How can I do that?
Here is the code I am using to display the grid.
<asp:Repeater id=Repeater1 runat="server">
<ItemTemplate>
<tr>
<td width="30%" align="center" nowrap class="btext"><%#
((clsModifier)Container.DataItem).Price.ToString(" $#,##0.00")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
Thanks.
George.
Ken Cox [Microsoft MVP] Guest
-
George Ter-Saakov #3
Re: how to show predefined text instrad of value in Repeater.
Thanks.
Did not know that IIF exists. Just started to learn .NET
George.
"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@sympatico.ca> wrote in message
news:enA9Ej$TDHA.2264@TK2MSFTNGP11.phx.gbl...> Hi George,
>
> How about inserting an IIF in there as you evaluate the item?
>
> <table>
> <asp:repeater id=Repeater1 runat="server">
> <itemtemplate>
> <tr>
> <td width="30%" align="center" nowrap ><%#
> iif(DataBinder.Eval(Container.DataItem, "UnitPrice")=0,"NA",
> format(DataBinder.Eval(Container.DataItem, "UnitPrice"),"$#,##0.00") )%>
>
> </td>
> </tr>
> </itemtemplate>
> </asp:repeater> </table>
>
> Does this help?
>
> Ken
> MVP [ASP.NET]
>
>
> "George Ter-Saakov" <we@hotmail.com> wrote in message
> news:ej4eWK7TDHA.2420@TK2MSFTNGP10.phx.gbl...
> Hi. I am trying to show the grid of prices.
> But if there is no price I want to show "NA". How can I do that?
>
> Here is the code I am using to display the grid.
>
> <asp:Repeater id=Repeater1 runat="server">
> <ItemTemplate>
> <tr>
> <td width="30%" align="center" nowrap class="btext"><%#
> ((clsModifier)Container.DataItem).Price.ToString(" $#,##0.00")%></td>
> </tr>
> </ItemTemplate>
> </asp:Repeater>
>
>
> Thanks.
> George.
>
>
George Ter-Saakov Guest



Reply With Quote

