本文介绍了与模式弹出窗口一起使用时,网格视图内的链接按钮不触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我已经为链接按钮使用了模式弹出扩展程序,该链接扩展器现在在Gridview内部,当我单击链接按钮时,我得到了模式弹出窗口,但是未触发链接按钮事件,请问如何引用我的代码并告诉我
模态弹出式扩展程序:

Hi
I have used a modal popup extender for a link button which is inside the gridview now when i click the link button i get the modal popup but the link button event is not getting fired how can it be done pl refer my code and tell me
modal popup extender:

<asp:TemplateField HeaderText="Reject">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkReject" runat="server" onclick="lnkReject_Click">Reject</asp:LinkButton>
                                <cc1:ModalPopupExtender ID="ModalPopupExtender1"  CancelControlID="btnCancel"  runat="server" TargetControlID="lnkReject" 
                                PopupControlID="Panel1" Drag="true" PopupDragHandleControlID="PopupHeader" >
                                </cc1:ModalPopupExtender>
                            </ItemTemplate>
                        </asp:TemplateField>


应该触发的事件


Event which should be fired

protected void lnkReject_Click(object sender, EventArgs e)
    {
        try
        {
            LinkButton lnkReject = (LinkButton)sender;
            GridViewRow gvRowApprove = (GridViewRow)lnkReject.NamingContainer;
            LinkButton lnkAssid = (LinkButton)gvRowApprove.FindControl("lnkAssId");
            Label lblleaveType = (Label)gvRowApprove.FindControl("lblLeaveType");
            int leaveId = objApproveOrReject.getLeaveReqId(lnkAssid.Text.Trim(), "pending", lblleaveType.Text);
            Session["LeaveType"] = lblleaveType.Text;
            Session["leaveId"] = leaveId;
            string url = "lms_Rejection.aspx";
            ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "openPopup", "window.open('" + url + "','_blank','height=400,width=400,status=yes,toolbar=no,menubar=no,location=yes,scrollbars=yes,resizable=no,titlebar=no' );", true);
        }
        catch (Exception ex)
        {
            throw (ex);
        }
    }

推荐答案


这篇关于与模式弹出窗口一起使用时,网格视图内的链接按钮不触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 23:41