Popup ajax ModalPopupExtender after logged in to the kentico site

Arshad Kunnath asked on August 7, 2017 06:11

I am using an Ajax modalpopupextender control to popup a daily inspirational quote message to the employee soon after he is logged into the kentico website.

In the LogonForm.ascx, i have added this code :

<cc1:ModalPopupExtender ID="mpePopUp" runat="server" PopupControlID="pnlMessageBox"
TargetControlID="lblHidden" BackgroundCssClass="MessageBoxPopupBackground">

<asp:Panel runat="server" ID="pnlMessageBox">
.... 
 </asp:Panel>

And to the end of Login1_LoggedIn method with in the codebehind file (LogonForm.ascx.cs),

mpePopUp.Show();

URLHelper.Redirect(redirectUrl);

Unfortunately no message is popping up after a successful login. I have tried the same code in a button placed outside the <asp:login> control, and it works perfect.

How i will force the modalpopupextender control to display after a successful login and before showing the redirect url?

Recent Answers


Roman Hutnyk answered on August 7, 2017 09:20

Your issue is that you open popup and immediately redirect user to the redirect url.

If you remove/comment our URLHelper.Redirect(redirectUrl); line you should see the popup.

I'd recommend adding some button to your popup (e.g. OK) and perform actual redirect whenever user clicks that button.

0 votesVote for this answer Mark as a Correct answer

Arshad Kunnath answered on August 7, 2017 12:25

Thanks Roman for a quick reply.

But even if i have commented the Redirect url, the popup is not showing up on the screen.

I have tried debugging the code, and the code successfully passes the mpePopUp.Show(); line without any error.

0 votesVote for this answer Mark as a Correct answer

John Smith answered on August 8, 2017 16:22

Hello,

Why not show the popup on the page you redirect the employee to instead?

Thanks,

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.