Xamarin Rg.Plugins.Popup Cancel Load - xamarin.forms

I'm trying to cancel the load (basically, close the popup window during loading) if I detect that there is some problem. No internet connection to retrieve the data for the popup for instance.
await PopupNavigation.PopAsync() is what is in my Close method that I normally use, but it seems like it is getting called too early. I can still manually close the window by clicking on a Close button which invokes the Close method, but I don't want the users to have to do that.
Is there some way to abort the load, or get a notification when the page is done loading so I can programmatically exit it?

Related

How to prevent browser from ‘back button’ when file upload is initiated by iframe and parent page has been routed using html5-history API?

I have an iframe (implemented using vuejs) inside a parent page (a .net C# page).
iframe has a file upload feature and user can press back button (or refresh) while upload is in progress. Parent page has implemented html5-history API.
My goal is to prevent browser to go back, on user action (showing the alert popup - the one is generated by beforeunload event)
DETAILS: refresh works as expected, because this emits beforeunload event.
but back button does not emit beforeunload event. (because page was not opened directly, instead pushState was used.)
I expect that user has some way to 'not leave' page when upload is interrupted by browser-back button. (what is happening now?)But user is able to just go back and upload is aborted without any alert.

Meteor: Fire Event on Browser Back Button

I am using Meteor.JS and want to fire an event (Animating the Closing of a modal) when the user hits the Browser's Back button and want to avoid in some cases, that the back default behaviour happens (so only close modal, do not change page, at second click change page)
Consider using history.pushState to change the URL bar when your modal appears, so that going Back does the right thing. A library like backbone.js or a Meteor package like iron:router can help with this.

To close popup window

I am opening form in popup window ,when i click on close button it fires click event of close button and it closes the window but again it calls page load event of the window and popup remains open until i explicitly close it by clicking browser close button.I have checked
IsPostback.Please help me to close the window
Ensure that it is not being reopened on your page load event. Ideally you should not be calling a server side event to close a window. This type of action should be handled client side with JavaScript to provide your users with a smoother
user experience.
You can achieve this by adding a OnClientClick event to your button and handle the close event via a function.

do not open pop up on session expires

I have a page in asp.net. A button click in the page will open a pop-up.
Now if session is expired, it is opening the pop-up window and in the pop-up it is showing the login screen.
Is there any way in which i can avoid pop-up being opened if the session is expired and directly go back to login page?
When you say pop-up, do you mean window.open? If so, then you have to make a AJAX call to verify the session, before opening the new window.
I am not sure I understand your requirement clearly. There is no exact way to achive this. But we can do it javascript.
put a timer(duration would be session timeout, use settimeout function) in the parent page. Check this value before open a popup.

Handling Browser close event and Page Refresh

In our application we need to handle browser close event. When a user directly closes the browser, we should give him an alert message and stop him by directly closing the window based on some conditions. This we have handled through body onunload event. The problem is we are getting the alert message but after showing the alert message the window gets closed.
Is there any way to stop closing the window on click of browser close event?
And also when the page is refreshed, the last performed action is getting fired again. Please provide your suggestions for avoiding this.
The short answer to your first question is: no. Application-level events in most browsers cannot be stopped by code in your webpage.
For your second question, you would need to put the code you want to execute into a conditional block:
if(!IsPostback)
{
//execute my code.
}

Resources