Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling LinkButton in a DataRepeater

Status
Not open for further replies.

phinoppix

Programmer
Jul 24, 2002
437
US
I have a linkbutton in a datarepeater. What I'm trying to do is disable this control on rows meeting a criteria. To illustrate:

Code:
</itemtemplate>
    <span>allow edit:</span>
    <%# DataBinder.Eval(Container.DataItem, "nEdit")%>
    <asp:LinkButton id="LinkButton1" runat="server" CommandName="edit" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "eventid")%>'>edit</asp:LinkButton></td>
</itemtemplate>

if nEdit = 1 then LinkButton1 is enabled, or otherwise. something like...
Code:
<% b = (Container.DataItem("nEdit") = gAllowEdit) %>
       <asp:LinkButton id="LinkButton1" runat="server" Enabled=<%# b%>></asp:LinkButton>

Any help please?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top