Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <asp:TemplateField>
- <ItemTemplate>
- <asp:ImageButton ID="imgbtnEdit" CommandName="Edit" runat="server" />
- </ItemTemplate>
- </asp:TemplateField>
- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- int screenshotId = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "screenshotId"));
- ImageButton btnShowImage = e.Row.FindControl("imgbtnEdit") as ImageButton;
- if (screenshotId > 0)
- {
- btnShowImage.Visible = true;
- Response.Write(screenshotId + "<br />"); //here the value are 1
- }
- else
- {
- btnShowImage.Visible = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement