I am having a grid view with the following fileds
Attachment(Link Button) and Comment(Link Button)
When i click on attachment i would like to download the file and when i click on Comments i would like to show the comment in a pop up. For this i used modal pop-up.
But as per the code i written this both works for first attempt on the page load later on both or not working how to solve this..
My grid design is as follows
<asp:GridView ID="grdAttaches_Client" runat="server" AutoGenerateColumns="false"
CssClass="GridViewStyle" Width="585px" OnRowCommand="grdAttaches_Client_RowCommand"
OnRowDataBound="grdAttaches_Client_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Attachment Name">
<ItemTemplate>
<asp:LinkButton ID="lblAttachmentName" Text='<%#Eval("AttachmentName")%>' runat="server" CommandName='Attachement' CommandArgument='<%# ((GridViewRow) Container).RowIndex %>' />
<asp:Label ID="lblAttachmentid" runat="server" Visible="false" Text='<%#Eval("Attachmentid")%>'></asp:Label>
</ItemTemplate>
<ItemStyle CssClass="grid-left-txt2" />
</asp:TemplateField>
<asp:TemplateField HeaderText=" Comment">
<ItemTemplate>
<asp:LinkButton ID="LinkButtonEdit" CommandName="ShowPopup" OnClick="lnkcommentsClick" runat="server"
Text='<%# Eval("Comments").ToString().Substring(0, Math.Min(Eval("Comments").ToString().Length, 10)) %>' CommandArgument='<%# ((GridViewRow) Container).RowIndex %>' > </asp:LinkButton>
<asp:Label ID="lblComments1" runat="server" Visible="false" Text='<%#Eval("Comments")%>'></asp:Label>
</ItemTemplate>
<ItemStyle CssClass="grid-left-txt2" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="RowStyle" />
<EmptyDataRowStyle CssClass="EmptyRowStyle" />
<PagerStyle CssClass="PagerStyle" />
<HeaderStyle CssClass="HeaderStyle" />
<EditRowStyle CssClass="EditRowStyle" />
<AlternatingRowStyle CssClass="AltRowStyle" />
<SelectedRowStyle CssClass="grid_data" />
<PagerSettings Position="TopAndBottom" />
</asp:GridView>
On Row command i write as follows
if (e.CommandName == "Click")
{
GridViewRow gvRow = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
LinkButton lbl_bs_id = (LinkButton)gvRow.FindControl("lnkcomments");
//Response.Write(lbl_bs_id.Text);
lnkcommentsClick(lbl_bs_id, EventArgs.Empty);
}
else
{
string fname = e.CommandName.ToString();
int aid = Convert.ToInt32(e.CommandArgument.ToString());
FileDownload(fname, true, aid);
}
But i am unable to work it out for multiple time. When the page was loaded i am able to show the pop up or file download. What to do inorder to get working all the time