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: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 :
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?