Switch control state in repeater based on database values

Discussion in 'ASP .Net Web Controls' started by Imran Aziz, Aug 10, 2005.

  1. Imran Aziz

    Imran Aziz Guest

    Hello All,
    I display a list of entries with a checkbox against them using a
    repeater control bound to a database table. Based on the value of database
    table I want to either show the checkbox for a row or not to show, how do I
    accomplish that using a repeater control ?
    Should I do something like this

    <%if (((DataRowView)Container.DataItem)["bThisUserHasIt"] == 0)

    { %><asp:CheckBox ID="chkBookMarkID" text='<%#
    ((DataRowView)Container.DataItem)["nBookMarkID"] %>' runat="server"
    ForeColor="White" Font-Size="1px" /<%} %>


    (this one does not work , but I am thinking it might be possible to do it
    like that, get this error, Error 2 The name 'Container' does not exist in
    the current context
    C:\Inetpub\wwwroot\allenandovery\bookmarks\recentbookmarks.aspx 24 35
    C:\...\allenandovery\
    )

    or is there a better way to do it, checking and specifying the value in code
    behind?


    Thanks a lot for your support.
    Imran.
     
    Imran Aziz, Aug 10, 2005
    #1
    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. Darren Smith
    Replies:
    5
    Views:
    5,541
    dsmith
    May 10, 2004
  2. Replies:
    4
    Views:
    9,275
  3. Imran Aziz
    Replies:
    3
    Views:
    3,249
    Imran Aziz
    Aug 11, 2005
  4. xz
    Replies:
    9
    Views:
    545
    James Kanze
    Jan 8, 2008
  5. Switch Within A Switch

    , Apr 22, 2006, in forum: Javascript
    Replies:
    7
    Views:
    120
    Lasse Reichstein Nielsen
    Apr 22, 2006
Loading...

Share This Page