Hello, support!
I have created a WPF application that contains
WebControl element (libraries version:
EO.Total 20.2.19):
Code: XML
<eo:WebControl x:Name="WebControl">
<eo:WebControl.WebView>
<eo:WebView>
</eo:WebView>
</eo:WebControl.WebView>
</eo:WebControl>
WebControl loads some URL (customer card) in the code-behind successfully. In addition, I have subscribed to a
NewWindow event that occurs when
WebView opens a new window:
Code: C#
WebControl.WebView.NewWindow += WebViewNewWindowEventHandler;
...
if (!string.IsNullOrEmpty(_workplaceUrl))
{
WebControl.WebView.LoadUrl(_workplaceUrl);
}
I would like to open the target url from NewWindow event args in the existing WebControl.WebView without additional window creating.I tried two
WebViewNewWindowEventHandler implementation:
Code: C#
private void WebViewNewWindowEventHandler(object sender, NewWindowEventArgs e)
{
WebControl.WebView.LoadUrl(e.TargetUrl);
}
In this case,
WebControl loads
e.TargetUrl successfully. But before that, a dialog message appears stating that the new window may be blocked by the pop-up blocker.
Code: C#
private void WebViewNewWindowEventHandler(object sender, NewWindowEventArgs e)
{
WebControl.WebView = e.WebView;
e.Accepted = true;
}
In this case, the required webpage does not load within the browser element and I get a blank form.
Is there a correct way to open a webpage (
NewWindowEventArgs.TargetUrl) in the main
WebControl.WebView without displaying a dialog message?
Can you help me with this problem? Maybe it is something wrong in my logic?
Please advise.
Sincerely,
Dmitry.