Hi All,
I have Link button and grid in my page. When i click on Link button, i want certain data to be displayed in gridview in modal popup extender.
My problem is, link button event is firing only first time and modal popup is displayed. But when i click Second time on link button, click event
is not firing, but still popup is displayed. Why event is only firing for first time. Can anyone please help me.
Here i my code
<asp:Panel ID="pnlStudentLeave" runat="server" Width="100%" Height="520px" ScrollBars="Auto"><asp:LinkButton ID="lnkEdit" runat="server" Text="Edit" ForeColor="Blue" Style="text-decoration: underline" CausesValidation="false" OnClick="lnkEdit_Click"></asp:LinkButton><cc1:ModalPopupExtender ID="mpeDetails" runat="server" TargetControlID="lnkEdit" PopupControlID="pnlDetails" BackgroundCssClass="modalBackground" Enabled="False" DropShadow="false" Drag="true" /></asp:Panel>alse" Drag="true" /><asp:Panel ID="pnlDetails" runat="server" Visible="false" Width="70%"><asp:GridView ID="gvData" runat="server" AllowSorting="true" AlternatingRowStyle-Font-Names="Calibri" AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="2" DataKeyNames="pk_ID" ForeColor="Black" GridLines="Both" RowStyle-Font-Names="Calibri" ShowHeader="true" AutoGenerateSelectButton="true" Width="100%" OnSelectedIndexChanging="gvData_SelectedIndexChanging"><HeaderStyle CssClass="GridHeader" /><RowStyle CssClass="GridItem1" /><%--<RowStyle BackColor="#FFFFFF" Font-Size="12px" /><SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" /><HeaderStyle BackColor="#e3e3e3" Font-Bold="false" ForeColor="Black" Height="15px" />--%><AlternatingRowStyle BackColor="#fffff0" /><Columns><asp:BoundField DataField="Name" HeaderText="Name" ReadOnly="true" /><asp:BoundField DataField="DateOfDepature" HeaderText="Date of Departure" ReadOnly="true" DataFormatString="{0:dd/MM/yyyy}" /><asp:BoundField DataField="DateofArraival" HeaderText="Date of Arrival" ReadOnly="true" DataFormatString="{0:dd/MM/yyyy}" /><asp:BoundField DataField="DepartureFrom" HeaderText="From" ReadOnly="true" /><asp:BoundField DataField="DepartureTo" HeaderText="To" ReadOnly="true" /><asp:BoundField DataField="Amount" HeaderText="Amount (र)" /></Columns></asp:GridView><br /><div align="center"><asp:Button ID="btnClose" runat="server" CausesValidation="false" CssClass="btns" Text="Close" OnClick="btnClose_Click" /></div></asp:Panel>
protected void lnkEdit_Click(object sender, EventArgs e) { dtTable = //getting data from database if (dtTable != null) { ViewState["dtTable"] = dtTable; gvData.DataSource = dtTable; gvData.DataBind(); pnlDetails.Visible = true; mpeDetails.Enabled = true; mpeDetails.Show(); } } protected void gvData_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { mpeDetails.Hide(); } protected void btnClose_Click(object sender, EventArgs e) { pnlDetails.Visible = false; mpeDetails.Enabled = false; mpeDetails.Hide(); }