Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have made a page by using modal pop up extender and i use update panel to load data from database to a gridview , and have a button to load it.. below is my code :
ASP.NET
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
            <ContentTemplate>
                <asp:Button ID="btnShowMPEHidden" runat="server" Text="Show MPE (Hidden)" Style="display: none" />
                <asp:ModalPopupExtender ID="MPE1" runat="server"
                    TargetControlID="btnShowMPEHidden" PopupControlID="Panel1" DropShadow="true"
                    OkControlID="btnClose" BackgroundCssClass="modalBackground" />
                <asp:Panel ID="Panel1" runat="server" Enabled="true" Style="display: none"
                    CssClass="modalPopup">
                <asp:GridView ID="GridHstApprove" runat="server" AutoGenerateColumns="False"
                    Width="1119px" GridLines="Both" Border="0px" >
                    <Columns>
                    <asp:TemplateField HeaderText="NO. DP">
                            <ItemTemplate>
                                <asp:Label ID="lblno_pengajuan" runat="server" ForeColor="Black" 
                                    Text='<%# Eval("no_pengajuan") %>' Width="20px"></asp:Label>
                            </ItemTemplate>
                                <ControlStyle Width="150px"></ControlStyle>
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" Width="150px" />
                        </asp:TemplateField>
                          <asp:TemplateField HeaderText="ROLE">
                            <ItemTemplate>
                                <asp:Label ID="lblhstrole" runat="server" ForeColor="Black" 
                                    Text='<%# Eval("role") %>'></asp:Label>
                            </ItemTemplate>
                              <ControlStyle Width="150px" />
                              <HeaderStyle HorizontalAlign="Center" />
                              <ItemStyle HorizontalAlign="Center" Width="150px" />
                        </asp:TemplateField>
  </Columns>  </asp:GridView>

<asp:LinkButton ID = "lnkFake" runat="server"
        onclick="lnkFake_Click" />


when I click the push of a linkfake button then modalpop up will be display , like below :
C#
protected void lnkFake_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            tampil_hst_approve(lblnopengajuan.Text);
            MPE1.Show();
        }
    }              


  private void tampil_hst_approve(string nopengajuan)
    {
        dt = mda.GetData("select no_pengajuan, userid, tgl_proses, role , status, keterangan from hst_approval where no_pengajuan='" + nopengajuan + "'", connStr).Tables[0];
        GridHstApprove.DataSource = dt;
        GridHstApprove.DataBind();
    }

I ask, how when I click the linkfake button and then show MPE1.Show() and tampil_hst_approve (lblnopengajuan.Text) without refreshing a page?
whether to use javascript? how to it?
is there a way?
Posted
Comments
King Fisher 23-Mar-15 12:09pm    
set UpdateMode="Conditional"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900