0
我有一個ajax模式彈出式擴展器,我用它來顯示一些數據的網格視圖。看來,之前的數據綁定到GridView ModalPopup彈出:Ajax ModalPopUp擴展在執行之前的代碼之前彈出的代碼
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
被綁定,但彈出已彈出,即使有斷點NOTREACHED popup.Show()
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="always">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnrefresh" />
<asp:AsyncPostBackTrigger ControlID="grdrequisitionraisedbyme" />
</Triggers>
<ContentTemplate>
<div style="height: 300px; overflow-y: scroll;">
<asp:GridView ID="grdrequisitionraisedbyme" runat="server" CssClass="tabledata" OnRowCommand="grdrequisitionraisedbyme_RowCommand">
<Columns>
<asp:TemplateField HeaderText="Capex/Po No">
<ItemTemplate>
<asp:LinkButton ID="lnkclaimno" runat="server" ForeColor="#3366FF" Text='<%# Eval("CapexNo") %>'
CommandName="select"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="View History">
<ItemTemplate>
<asp:LinkButton ID="lnkviewhistory" runat="server" CommandName="viewhistory" ForeColor="#3366FF"
Text="View History"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<br />
<br />
</div>
<asp:Panel ID="pnlAddEdit" runat="server" CssClass="modalPopup" Style="display: none">
<asp:Label Font-Bold="true" ID="Label4" runat="server" Text="Customer Details"></asp:Label>
<br />
<table align="center">
<tr>
<td colspan="6">
<asp:GridView ID="grvcapexhistory" runat="server" CssClass="tabledata">
</asp:GridView>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClientClick="return Hidepopup()" />
</td>
</tr>
</table>
</asp:Panel>
<asp:LinkButton ID="lnkFake" runat="server"></asp:LinkButton>
<asp:ModalPopupExtender ID="popup" runat="server" DropShadow="false" PopupControlID="pnlAddEdit"
TargetControlID="lnkFake" BackgroundCssClass="modalBackground">
</asp:ModalPopupExtender>
</ContentTemplate>
</asp:UpdatePanel>
這是迄今爲止最簡單的模式彈出我也碰到過這麼遠。 我還沒用過它。稍後我會將其標記爲答案。 +1 – Arbaaz 2014-09-09 04:27:31