0

I have a link button on a tab panel which displays a ModalPopupExtender. The problem is its onclick event is not getting fired. Whenever the link button is clicked, the modal popup shows (which should happen) but the click event is not fired

<asp:LinkButton ID="lnkAddNewAddress" runat="server" OnClick="lnkAddNewAddress_Click">Click Here To Add New Address</asp:LinkButton>
                                            <asp:ModalPopupExtender ID="lnkAddNewAddress_ModalPopupExtender" runat="server" BackgroundCssClass="modalBackground"
                                                DynamicServicePath="" Enabled="True" PopupControlID="pnlMyAddressBook" TargetControlID="lnkAddNewAddress"
                                                ViewStateMode="Enabled">
                                            </asp:ModalPopupExtender>

 protected void lnkAddNewAddress_Click(object sender, EventArgs e)
    {
        GetCountryInLightBox();
        GetStateInLightBox();
        //lnkAddNewAddress_ModalPopupExtender.Show();
        ClearTextBoxes();
        ViewState["Click"] = "Add";
    }
Zo Has
  • 12,599
  • 22
  • 87
  • 149
who-aditya-nawandar
  • 1,334
  • 9
  • 39
  • 89

1 Answers1

0

The asp:ModalPopupExtender is prevent the post back - or else you never see the pop up to open.

To been able to see the javascript popup window, the post back action from the link must be hold. If you left the post back to happens, and your code behind runs, you never see the dialog.

Aristos
  • 66,005
  • 16
  • 114
  • 150
  • @AdityaNawandar Use javascript to clear your text boxes, and ajax to fill the other boxes. In general use javascript - from the moment you go with javascript dialog. – Aristos Mar 29 '13 at 14:27
  • @AdityaNawandar I really do not know / don't understand, your flow logic on what you wish to do for tell you more. – Aristos Mar 29 '13 at 14:29
  • I just want the click event to fire.. its not firing currently even though you may see code in it... the control never goes into the routine... – who-aditya-nawandar Mar 29 '13 at 14:38