This topic is locked

display a message in popup window afer page load

5/23/2024 1:44:57 AM
ASPRunner.NET General questions
D
david powell author

Hi,

I want to display a message in a popup window that the user has to close.

This is easy to do from a button, using something like

window.popup = Runner.displayPopup({
url: Runner.pages.getUrl("message_display","list"),
width: 900,
height: 900,
header: 'Message',
footer: '<a href="#" onclick="window.popup.close();return false;">Abandon changes and close window</a>'
});
in on before.

But I want this same popup window to occur automatically when a page loads , triggered by an event in , say, before display.

The problem I am having is that if I use a redirect command, I lose the original page i am loading - I dont want this to happen, I need the original page to be the active one after the popup is closed, and preferablyl be visible in the background whilst the user is looking at the popup.

How could I do this?

David

T
Tim 5/23/2024

How about using Sweet Alerts in Javascript Onload event:

https://xlinesoft.com/asprunnernet/docs/sweetalert-popups.htm

Or put the button on your page and "auto" click it when the page loads.

Javascript Onload:
$("#MyButtonName").trigger('click');

Tim