M
miaminemo
Guys -
I have my repeater working fine, but Im stuck on adding a button
conditionally to the repeater.
The repeater displays:
user,
questionAsked,
userAsked,
answer
I would like the repeater to have a 5th column populated with a button
that is visible only if the userAsked if the user currently running
the website.
i can add a button to the repeater but only for every row of the
repeater. I only want the button to be available when the user can
actually answer the question..
Here is my current code:
<asp:repeater id="Repeater1" runat="server">
<HeaderTemplate>
<table border="1">
<tr bgcolor="DarkGray">
<th>Timestamp</th>
<th>UserID</th>
<th>Comment</th>
<th>Question</th>
<th>Response</th>
<th>Response Author</th>
<th>Response Date</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr bgcolor="#ffcccc">
<td><%# DataBinder.Eval(Container.DataItem, "commentDate")
%></td>
<td><%# DataBinder.Eval(Container.DataItem, "userID") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "comment") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "question") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "answer") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "answerUID") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "answerDate")
%></td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr bgcolor="#ccff99">
<td><%# DataBinder.Eval(Container.DataItem, "commentDate")
%></td>
<td><%# DataBinder.Eval(Container.DataItem, "userID") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "comment") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "question") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "answer") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "answerUID") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "answerDate")
%></td>
</tr>
</AlternatingItemTemplate>
<FooterTemplate>
</TABLE>
</FooterTemplate> </asp:repeater>
I have my repeater working fine, but Im stuck on adding a button
conditionally to the repeater.
The repeater displays:
user,
questionAsked,
userAsked,
answer
I would like the repeater to have a 5th column populated with a button
that is visible only if the userAsked if the user currently running
the website.
i can add a button to the repeater but only for every row of the
repeater. I only want the button to be available when the user can
actually answer the question..
Here is my current code:
<asp:repeater id="Repeater1" runat="server">
<HeaderTemplate>
<table border="1">
<tr bgcolor="DarkGray">
<th>Timestamp</th>
<th>UserID</th>
<th>Comment</th>
<th>Question</th>
<th>Response</th>
<th>Response Author</th>
<th>Response Date</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr bgcolor="#ffcccc">
<td><%# DataBinder.Eval(Container.DataItem, "commentDate")
%></td>
<td><%# DataBinder.Eval(Container.DataItem, "userID") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "comment") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "question") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "answer") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "answerUID") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "answerDate")
%></td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr bgcolor="#ccff99">
<td><%# DataBinder.Eval(Container.DataItem, "commentDate")
%></td>
<td><%# DataBinder.Eval(Container.DataItem, "userID") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "comment") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "question") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "answer") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "answerUID") %></
td>
<td><%# DataBinder.Eval(Container.DataItem, "answerDate")
%></td>
</tr>
</AlternatingItemTemplate>
<FooterTemplate>
</TABLE>
</FooterTemplate> </asp:repeater>