Welcome Guest Search | Active Topics | Sign In | Register

Popup page Options
onizerga
Posted: Friday, February 10, 2017 4:34:38 AM
Rank: Newbie
Groups: Member

Joined: 2/10/2017
Posts: 5
Hi i have question?
1 I will buy web control version "EO.WebBrowser 2017 for .NET" for WPF application is correct?
2 In web control version "EO.WebBrowser 2017 for .NET" you handle "NewWindows" event for new window?

Thanks
eo_support
Posted: Friday, February 10, 2017 7:56:25 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

EO.WebBrowser can be used in either WPF application or Windows Forms application, or even without either one of them. It provides the core browser features. That part is platform independent.

You are correct about the NewWindow event. See here for more details:

https://www.essentialobjects.com/doc/webbrowser/advanced/new_window.aspx

Thanks!
onizerga
Posted: Wednesday, February 15, 2017 11:22:27 AM
Rank: Newbie
Groups: Member

Joined: 2/10/2017
Posts: 5
Thank you
onizerga
Posted: Friday, February 17, 2017 4:33:15 AM
Rank: Newbie
Groups: Member

Joined: 2/10/2017
Posts: 5
Hi I test your suggest link
https://www.essentialobjects.com/doc/webbrowser/advanced/new_window.aspx
but don't work for show dialog (I want to show dialog and return result to main page)

==================================================
//Assume BrowserWnd (in your code) is a Window class that contains a
//WebView. Here the code creates a new BrowserWnd object thus creating
//a new WebView
BrowserWnd wnd = new BrowserWnd();

//Load the target Url into the new WebView
wnd.WebView.Url = e.TargetUrl;

//Signifies that we accept the new window request
e.Accepted = true;


what is "BrowserWnd" ?
==================================================

My source code
==================================================
public void WebView_NewWindow(object sender, NewWindowEventArgs e)
{
try
{
WebControl wnd = new WebControl();
wnd.WebView.Url = e.TargetUrl;

e.Accepted = true;
}
catch (Exception)
{ }
}
==================================================

Please suggest me
Thanks
eo_support
Posted: Friday, February 17, 2017 7:22:16 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

The sample code you referenced from our documentation is an example of a common MISTAKE. The text before that code says "A common mistake in handling this event is to create a new WebView to load the Url". And you repeated this mistake in your code. Please read the rest of the documentation on why this is wrong. If you still have question, please let us know and we will be happy to help you further.

Thanks!
The Communication Solution Co., Ltd.
Posted: Sunday, February 19, 2017 10:46:51 PM
Rank: Newbie
Groups: Member

Joined: 2/17/2017
Posts: 1
Hi

Now I can set popup already but how to return value from popup page to main page

my source code to show popup page

private void WebView_NewWindow(object sender, NewWindowEventArgs e)
{
System.Windows.Forms.Form mainPopupForm;
EO.WebBrowser.WinForm.WebControl _WebBrowerOnPopup;
try
{
e.Accepted = true;
_WebBrowerOnPopup = new EO.WebBrowser.WinForm.WebControl();
mainPopupForm = new System.Windows.Forms.Form();

mainPopupForm.ClientSize = new System.Drawing.Size(Convert.ToInt32(e.Width), Convert.ToInt32(e.Height));
mainPopupForm.Controls.Add(_WebBrowerOnPopup);
_WebBrowerOnPopup.Dock = DockStyle.Fill;
_WebBrowerOnPopup.WebView = e.WebView;
mainPopupForm.Show();
}
catch (Exception)
{ }
}


please suggest to return value to main page
Thanks


onizerga
Posted: Sunday, February 19, 2017 10:49:53 PM
Rank: Newbie
Groups: Member

Joined: 2/10/2017
Posts: 5
Hi

Now I can set popup already but how to return value from popup page to main page

my source code to show popup page

private void WebView_NewWindow(object sender, NewWindowEventArgs e)
{
System.Windows.Forms.Form mainPopupForm;
EO.WebBrowser.WinForm.WebControl _WebBrowerOnPopup;
try
{
e.Accepted = true;
_WebBrowerOnPopup = new EO.WebBrowser.WinForm.WebControl();
mainPopupForm = new System.Windows.Forms.Form();

mainPopupForm.ClientSize = new System.Drawing.Size(Convert.ToInt32(e.Width), Convert.ToInt32(e.Height));
mainPopupForm.Controls.Add(_WebBrowerOnPopup);
_WebBrowerOnPopup.Dock = DockStyle.Fill;
_WebBrowerOnPopup.WebView = e.WebView;
mainPopupForm.Show();
}
catch (Exception)
{ }
}


please suggest to return value to main page
Thanks
eo_support
Posted: Monday, February 20, 2017 8:51:01 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

How to communicate between the two pages are unrelated to EO.WebBrowser and should be done through JavaScript (If you write code rely on EO.WebBrowser for this part, then your page won't work in a regular browser). We do not provide support on JavaScript, so you can search online on how to get value back from a popup window online. You should be able to find plenty of information about that topic.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.