Handling 3rd party popup windows within a Xamarin Forms WebView? - xamarin.forms

How can I handle popup windows from within a WebView?
The initial WebView displays a site from a third party, which in turn can trigger and should display a popup window based on the user's interaction within the webview.
Currently, the popup window fails to show?

Webview does not support javascript. You will need to create custom control to achieve this. You can check those two articles to implement something that will suit your needs.
Hybrid webview
Webview executing javascript

Related

how to create a pop up window #2

is there a way to create a pop-up window in a VB.Net application, specifically when a button has been clicked?
I'm designing a little help section on a web application I'm working on, and I wanted to have a variety of written steps followed by some sort of "Click here for an example" button that brings up a new window (not a new page, just a new window). The window would simply contain an image control displaying a picture that describes the written steps.
The best example I can come up with is here on Amazon when ordering a clothing item such as a pair of shoes. When the user clicks the "Sizing Info" link button, a pop-up window appears with information to help you order the correct size.
So is there a way to create a pop up like that in VB.Net?
In vb.net not, websites are handled differently. For displaying a popup using asp.net you need a client-side language, like javascript.
For instance this nice jquery script http://jqueryui.com/dialog/
Your vb.net can't open dialogs on client-side. If you need to get/send some information from the server, simply use webservices to send/fetch the information using ajax.

How can I open an aspx page in a new browser window from a SilverLight Application?

I want to add a button to my user control in SilverLight 4.0 application which will open a new browser window with an aspx in it when it is clicked.
How can I achieve this, can you please advice?
Additionaly, can I lock the SL application until this new window is closed (Alike a modal dialog)?
thanks!
You can open a new window with:-
HtmlPage.Window.Navigate(uriToNewPage, "_blank");
However modal dialogs depend on the specific browser that is hosting.
Internet Explorer and Firefox both have a showModalDialog method on their window objects. You would need to use the Invoke method to fire these:-
HtmlPage.Window.Invoke("showModalDialog", urlString);
Use the HyperlinkButton control. You can specify to open in a new tab or new browser window.
(There is also a navigate option available from the Http class, but I will have to look up the syntax).
To do the modal popup scenario, you would need to generate a popup in Javascript on the browser hosting the SL control (which you can trigger from within Silverlight).

How do I build a popup dialog in asp.net

I am building a Web Application using asp.net (C#). I come from windows forms development and find myself in a hard spot. Im making an application where the user should edit some simple information about himself, and thus i need to create a new dialog. How do I do that in asp.net? I have a button which event is handled serverside, and when i click lthis button i want to popup a dialog where i can show my custom web control (or any web control, lets make it generic from the start). How do I go about with doing so?
I got some part of the way by looking at the internet, that i need to make a section and set the z-index to 1000, but how do i make it visible (block)? Please help here as i am completely lost...
/H4mm3rHead
If you're not concerned about using a library, try Microsoft ASP.NET AJAX Control Toolkit, they have several controls that can create something you want (the ModalPopup control).
The AJAX Control Toolkit has a ConfirmButton extender which will do exactly what you are looking for.
I used to do the following:
1. my new pop up is just a new aspx page like any other page
2. add a button (or just a link) that fires a client side java script function
3. in the function I use window.open and put params to open my popup page with no toolbars or scrollbars and proper size to its content
check this for more info on #3

ASP.NET AJAX CalendarExtender - Problem with Android Browser

I'm creating a webapp for Android mobile phones with ASP.NET and the Ajax Control Toolkit.
I've included a CalendarExtender-Control which popups a calendar when focusing the associated Textbox-Control.
If I select this textbox on my mobile phone, the Android webbrowser highlights it with an orange border. The problem is that this border is shown in front of my Calendar popup. Has anybody any idea how to fix this issue?
Thanks!
Puh...that behavior is done by the Android OS on all input fields. It doesn't depend on your web application and I doubt you have a possibility to disable this behavior, at least for sure not through your web application.
As a workaround, have you tried to use an additional calendar button and make the date picker just pop up if you click on that calendar button? For sure less usable, but it might work.

Using XMLHttpRequest to display a popup

I am writing an ASP.NET 3.5 web app that displays a list of items. I want to be able to display a non-modal popup with details when the user selects an item. I want to be able to display several detail popups simultaneously. (i.e., the user can click an item to see its details, then click another item to get another popup.) Currently I call RegisterStartupScript during postback to write a "window.open(...)" script to the page when it re-renders. The problem, of course, is that this requires a full page postback and refresh.
It occured to me that this might be a perfect use for XMLHttpRequest or AJAX but I don't know how to do it (or whether it's even possible or smart to do this). Can someone show me the way?
I have the AJAX Extensions installed but I'd prefer not to use the AJAX Control Toolkit.
EDIT:
Some clarification: When the user selects an item a custom event is raised. On the server I handle this event and use some server-side logic to construct a URL which I then use with RegisterStartupScript to construct a "window.open(myUrl...)" script. But posting back the whole page to do this seems inefficient and I'd like to know if I can just make a call to a simple server-side function that constructs the url and sends it back without having to roundtrip the entire page.
Creating a popup has very little to do with AJAX, and a lot more to do with JavaScript. See the jQuery dialog library here. You can then use jQuery's AJAX API to do your server dirty work :)
jQuery Dialog UI
--
Bill Konrad
Devtacular - Web Development Tutorials
You can use DHTML Window widget.
It offers many way to display either modal or non modal window.
Also it supports AJAX.
You can use dhtmlwindow for open a new window, or
dhtmlmodal to open a new modal window.
Of course, you can edit it to match your requirement.
Sample:
var insWindow = dhtmlmodal.open("insbox", "iframe","UserMaster.aspx?" + queryStr, "User Master", "width=425px,height=500,center=1,resize=0,scrolling=1", "recal");
Do you really need to open a new window? Opening an absolutely positioned DIV or a new layer on top of the current page in the same window is all the rage these days.
Edit:
I don't think it would limit the number of popups, there is some neat stuff that can be done these days with libraries like jQuery + jQuery UI, you can simply create as many of these DIVs/layers as you need and make them movable, resizable, etc. Only thing that real popups have and these do not is that they do not appear on the tab panel/taskbar.
Yes, you will be limited to the size of the window in which is the main page opened, however, I don't personally see it as a problem since most people surf in a maximized browser window anyways.
Implementation of the oldschool typical popup window is undoubtedly much easier for you, but it also runs into problems with end user popup blockers. Just had that problem # my work, they needed to make a popup during the certificate authentication process for some reason and as soon as Yahoo released a new version their toolbar, it quit working).

Resources