DataList question

S

sameer

Hi All,
Environment: ASP.Net , framework 1.1, VS2003. Database: Sql server 2000

I have an MS DATALIST which has Item Templates, show the image and the price
right next to the "PRICE" text. the image name and the Price is being
populated from the datbase. All i do it get a datatable frm the database and
set it to the datasource of the grid it autoppulates it. The code in the HTML
section of the page for the grid which tells what fields are to be writen and
where to write them is :


<HeaderTemplate>
</HeaderTemplate>

<ItemTemplate>
<TABLE height=126 width=194 border=0>
<TR>
<TD><IMG height=136 src='<%# DataBinder.Eval(Container.DataItem,
"ProductImage") %>'></TD>
<TD class="plaintext">PRICE : '<%# DataBinder.Eval(Container.DataItem,
"price") %>'>
</TR>
</TABLE>
</ItemTemplate>

Now i want to add another field in their from the datatable which will haev
the sale price, and if their is a sale price for an item only then the Class
prperty of the PRICE Value should be "StiredNormalText" so that the price is
striked out and the the Sale price should appear benath it, once again if
their is no saleprice for an item then the CLASS of the Lable only for that
item should be "plaintext" and if their is then it should be
"StiredNormalText". their coudl be multuple records in the datatable. how can
i do this, can it be done? Please suggest.

Sameer
 
P

Phillip Williams

<TD>PRICE :
<span class='<%#IIF(DataBinder.Eval(Container.DataItem,"SalePrice") >
0,"strikeOverStyle","plaintext")%>'>
<%# DataBinder.Eval(Container.DataItem, "price") %>
</span>
<br/>
Sale Price : <%# DataBinder.Eval(Container.DataItem, "SalePrice") %>
</TD>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top