Results 1 to 3 of 3

Thread: Repeater question

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2003
    Posts
    22

    Repeater question

    Dear all,

    There are three columns in my dataview, "code", "amount_1" and "amount_2". Now I am using a Repeater to display the data in the dataview and what I need to do is when the paramters "ind" = 0, display "amount_1", otherwise display "amount_2", and my code is:

    ......
    <ItemTemplate>
    <%
    If Request.QueryString("ind") = "0" then
    Response.Write(DataBinder.Eval(Container.DataItem,"amount_1")
    Else
    Response.Write(DataBinder.Eval(Container.DataItem,"amount_2")
    End If
    %>
    </ItemTemplate>
    ........


    But I got an error "BC30451 'Container' not declare....", anyone know whats wrong in my code since I'm new in ASP .NET

    Regards,
    Calvin

  2. #2
    Lively Member
    Join Date
    Sep 2004
    Location
    india
    Posts
    95

    Repeater

    if u use DataGrid control u can easily make changes what u want.

    1 . In code behind use Data Table to dynamicaly add columns and merge it to new Dataset.

    2. Bind that Dataset to Datagrid or Bind Datatable Default view to Datagrid.

  3. #3
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    Have you ever looked at XSLT sheets?

    Now I am not that good at ASP.NET, but have a reasonable grasp on it, and from what I have seen XSLT sheets are much easier to use.

    You can even have a reference to a VB class in the XSLT sheet, which allows you to run VB functions.

    Attched is a small demo.

    You need to create a DB with a Users table and the following fields:
    • ID
    • Username
    • Password
    • RegisteredDate

    Datatypes should be pretty much self explanatory from the field names.

    Woka
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width