I Have Two Pages when I press the Link Button in Gridview1 of FirstPage it will Redirects To Second Page and Append Text in Textbox and Displys Gridview2.i Wrote this Logic is (!IsPostBack), Now when i Press the Link Button in GridView2 of Second Page Another Gridview3 is Displayed in Modal Popup Extender. My Issue is When i Press the Link Button in Gridview2 of Second Page GridView3 is Displayed but page is Refreshed..i want to Avoid the Page Refresh and In Modal Pop up Extender Close Button will not be Worked. How can i resolve this... What I have tried: My Code
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <asp:UpdatePanel ID="gv_UpdatePanel" runat="server"> <ContentTemplate> <div> <asp:GridView runat="server" ID="GridView2" DataKeyNames="OrderId" OnRowDataBound="GridView2_OnRowDataBound" OnRowEditing="GridView2_RowEditing" OnRowCancelingEdit="GridView2_RowCancelingEdit" OnRowUpdating="GridView2_RowUpdating" AutoGenerateColumns="false" CssClass="ChildGrid_font" GridLines="None" <Columns> <asp:BoundField HeaderText="Number" SortExpression="No" DataField="No" <asp:BoundField HeaderText="OrderId" SortExpression="OrderId" DataField="OrderId" <asp:BoundField HeaderText="Date" SortExpression="Date" DataField="Date" <asp:TemplateField HeaderText="Audit"> <ItemTemplate> <asp:LinkButton ID="Linkbtn" runat="server" Text="Show" OnClick="Edit"></asp:LinkButton> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </ContentTemplate> </asp:UpdatePanel>
My Modal Pop Up Code
<asp:Button ID="btnTemp" runat="server" Visible="false" /> <asp:ModalPopupExtender ID="modalPopup" runat="server" TargetControlID="btnTemp" PopupControlID="popup" CancelControlID="btnCancel"> </asp:ModalPopupExtender> <asp:Panel ID="popup" runat="server"> <div> <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="false" GridLines="None"> <AlternatingRowStyle BackColor="#e7e8e9" /> <RowStyle BackColor="#f5dec0" /> <Columns> <asp:BoundField HeaderText="Id" SortExpression="Id" DataField="Id" <asp:BoundField HeaderText="Number" SortExpression="No" DataField="No" </Columns> </asp:GridView> </div> <asp:Button ID="btnCancel" runat="server" Text="Cancel"/> </asp:Panel>
cs code:
protected void Edit(object sender, EventArgs e) { Number = txt.Text; var list=getDate(Number) Gridview3.DataSource = getDate; Gridview3.DataBind(); modalPopup.Show(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)