Friday 15 April 2011

asp.net - Conditionally show hide asp linkbutton -



asp.net - Conditionally show hide asp linkbutton -

i have below link button , need show if grid has records.

<asp:linkbutton id="linkbutton1" runat="server" tooltip="delete file" visible='<%# (convert.toint32(eval("gridviewfileinformation.rows.count"))>0) %>' >delete</asp:linkbutton>

but shows always.

in code behind file after databind of "gridviewfileinformation" can set visible property of linkbutton1. similar question

something like:

aspx file:

<asp:gridview runat="server" id="gridviewfileinformation" ondatabound="gridviewfileinformation_databound"> </asp:gridview>

cs file:

protected void gridviewfileinformation_databound(object sender, eventargs e) { linkbutton1.visible = (gridviewfileinformation.rows.count > 0); }

asp.net dynamic

No comments:

Post a Comment