Hello,
I am trying to get a popup after saving some data into the database. When using the ConfirmButtonExtender and ModalPopupextender, it asks for TargetControlID. So i have given TargetcontrolID as Submit button. So whenever the submit button is clicked, it shows the popup first saying "your password is successfully saved". After you close the popup, it saves information in the database. This shouldn't be the case. It has to first save the information in database and if it successfully saves the password, popup should be shown. What do you think i should change? Please help..
<cc1:ConfirmButtonExtender DisplayModalPopupID="ModalPopupExtendersave" ID="ConfirmButtonExtendersave"
runat="server" TargetControlID="imgbtnSubmit">
</cc1:ConfirmButtonExtender>
<cc1:ModalPopupExtender ID="ModalPopupExtendersave" runat="server" TargetControlID="imgbtnSubmit" BackgroundCssClass="modalBackground"
OkControlID="btnOK" PopupControlID="pnlPopup" >
</cc1:ModalPopupExtender>
protected void imgbtnSubmit_Click(object sender, ImageClickEventArgs e)
{
if (txtpassword1.Text != "" && txtpassword2.Text != "" && txtpassword1.Text == txtpassword2.Text)
{
Savepassword();
if (Savepassword())
{
ModalPopupExtendersave.Show();
pnlPopup.Visible = true;
}
else
{
lblerror.Text = "Error in saving password";
}
}
}
Thank you all!!