DataList question

Discussion in 'ASP .Net Web Controls' started by sameer, Mar 20, 2006.

  1. sameer

    sameer Guest

    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
    sameer, Mar 20, 2006
    #1
    1. Advertising

  2. <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>
    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "sameer" wrote:

    > 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
    Phillip Williams, Mar 20, 2006
    #2
    1. Advertising

  3. sameer

    sameer Guest

    thanks a lot Philip , u are the man!

    "Phillip Williams" wrote:

    > <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>
    > --
    > HTH,
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    > "sameer" wrote:
    >
    > > 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
    sameer, Mar 22, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gönen EREN

    Datalist in Datalist How?

    Gönen EREN, Aug 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    392
    Gönen EREN
    Aug 22, 2003
  2. acko bogicevic

    DataList in DataList

    acko bogicevic, Nov 10, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    5,480
    acko bogicevic
    Nov 11, 2003
  3. Steve Lloyd
    Replies:
    1
    Views:
    679
    Rick Spiewak
    May 26, 2004
  4. Nevyn Twyll
    Replies:
    8
    Views:
    1,832
  5. Luis Esteban Valencia
    Replies:
    1
    Views:
    476
    John Saunders
    Jan 6, 2005
Loading...

Share This Page