C# Ajax ModalPopUp Extendar在执行代码隐藏中的前几行之前弹出
我有一个ajax模式弹出扩展程序,我正在使用它来显示一个包含一些数据的gridview。似乎在数据绑定到GridView之前会弹出ModalPopp:C# Ajax ModalPopUp Extendar在执行代码隐藏中的前几行之前弹出,c#,javascript,jquery,asp.net,ajax,C#,Javascript,Jquery,Asp.net,Ajax,我有一个ajax模式弹出扩展程序,我正在使用它来显示一个包含一些数据的gridview。似乎在数据绑定到GridView之前会弹出ModalPopp: protected void grdrequisitionraisedbyme_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("viewhistory")) { GridV
protected void grdrequisitionraisedbyme_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.Equals("viewhistory"))
{
GridViewRow clickedRow = ((LinkButton)e.CommandSource).NamingContainer as GridViewRow;
LinkButton lnkclaimno = (LinkButton)clickedRow.FindControl("lnkclaimno");
DataSet ds = new DataSet();
ds = GetHistory(lnkclaimno.Text.Trim());
grvcapexhistory.DataSource = null;
grvcapexhistory.DataBind();
if (ds.Tables[0].Rows.Count > 0)
{
grvcapexhistory.DataSource = ds.Tables[0];
grvcapexhistory.DataBind();
popup.Show();
}
}
}
我在绑定grvcapexhistory
的位置放置了一个调试器,但即使断点未到达popup.Show()
摆脱Ajax弹出窗口并使用以下选项。它会解决你的问题
<asp:Panel ID="popup" runat="server" visible="false">
<table style="position: fixed; z-index: 1; left: 0px; top: 0px" border="0" width="100%" height="100%">
<tr>
<td valign="top" align="center" >
// below div will automatically expand as much as needed
<div class="yourmodalclass" style=" display:inline-block;margin-top:90px; ">
//put your GridView ID="grvcapexhistory" and other stuff here
</div>
</td>
</table>
</asp:Panel>
这是迄今为止我遇到的最简单的模式弹出窗口。我还没用过。我稍后会把它标记为答案+1.
<asp:Panel ID="popup" runat="server" visible="false">
<table style="position: fixed; z-index: 1; left: 0px; top: 0px" border="0" width="100%" height="100%">
<tr>
<td valign="top" align="center" >
// below div will automatically expand as much as needed
<div class="yourmodalclass" style=" display:inline-block;margin-top:90px; ">
//put your GridView ID="grvcapexhistory" and other stuff here
</div>
</td>
</table>
</asp:Panel>