如何使用GridView Paging在jQuery弹出窗口中显示GridView? [英] How to show GridView in jQuery popup with GridView Paging ?
问题描述
大家好,
我无法在jQuery弹出窗口中显示GridView。 GridView包含它的页面index_changing事件。
我的.aspx代码如下:
Hi All,
I'm unable to show GridView in jQuery popup. GridView contains it's page index_changing event.
My .aspx code is below:
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" PageSize="3" OnPageIndexChanging="GridView1_PageIndexChanging"></asp:GridView>
<asp:LinkButton ID="lnkBtnPopup" runat="server" onclick="lnkBtnPopup_Click">Show PopUp</asp:LinkButton>
和我的.C S页面如下:
And my .CS page is as below:
protected void lnkBtnPopup_Click(object sender, EventArgs e)
{
GridView1.DataSource = GetData();
GridView1.DataBind();
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.DataSource = GetData();
GridView1.PageIndex = e.NewPageIndex;
GridView1.DataBind();
}
我的jQuery如下:
And my jQuery as as follows:
<script type="text/javascript">
$("[id*=lnkBtnPopup]").live("click", function () {
$("#GridView1").dialog({
title: "Hello World",
width: "200px",
buttons: {
Close: function () {
$(this).dialog('close');
}
}
});
return false;
});
</script>
当我点击LinkButton时,我想在jQuery弹出窗口中显示带分页的网格。 />
代码无效。请尽快帮助。
提前致谢。
I want to show Grid with paging in jQuery popup when I click on LinkButton.
The code is not working. Please help ASAP.
Thanks in advance.
推荐答案
( < span class =code-string> [id * = lnkBtnPopup])。live( click , function (){
("[id*=lnkBtnPopup]").live("click", function () {
( #GridView1)。dialog({
title: Hello World,
width: 200px,
按钮:{
关闭:功能(){
("#GridView1").dialog({ title: "Hello World", width: "200px", buttons: { Close: function () {
(此)。对话框(' close');
}
}
});
< span class =code-keyword> return false ;
});
< / script>
(this).dialog('close'); } } }); return false; }); </script>
当我点击LinkButton时,我想在jQuery弹出窗口中显示带分页的网格。 />
代码无效。请尽快帮助。
提前致谢。
I want to show Grid with paging in jQuery popup when I click on LinkButton.
The code is not working. Please help ASAP.
Thanks in advance.
这篇关于如何使用GridView Paging在jQuery弹出窗口中显示GridView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!