Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Switch control state in repeater based on database values

Thread Tools

Switch control state in repeater based on database values

Imran Aziz
Posts: n/a
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\recentb ookmarks.aspx 24 35

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

Thanks a lot for your support.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase Computer Information 0 09-26-2012 09:40 AM
show check box in repeater based on database value Imran Aziz ASP .Net 3 08-11-2005 04:57 PM
Repeater control - how to access contained control values? ASP .Net 4 05-28-2005 07:54 AM
Please HELP! Need to access textbox control values within a repeater control Darren Smith ASP .Net 5 05-10-2004 03:37 PM