WebBrowser question

W

WT

Hello,

The url I use for webbrowser has a button thta closes the browser.
How to catch this event ? WebBrowser is notr closing but stay inactive after
closing.
Is it possible to have something like window.showModalDialog(url)?

CS
 
S

Steven Cheng[MSFT]

Hello CS,

Regarding on the "catch webbrowser close event", do you mean you want to
detect webbrowser closing? If this is the case, I'm afraid so far web page
haven't any direct means to detect webbrowser window's closing. There
exists an "unload" event for <body> html element that can detect the
document(in browser)'s unloading(this will occur when the browser is closed
or the page has been refreshed).

BTW, if you possible, would you provide a public address of that url so
that we can have a look at the exact behavior?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

WT

This windows is inside MS CRM, uneasy to provide some url.
In fact the url I call from web browser is normally called from another main
page inside a popup, and it contains an 'Ok' button that closes the popup.
The javascript used is
function showlookup() {
var url;
url =
"http://crm/_controls/lookup/lookupsingle.aspx?class=null&objecttypes=2&browse=0"
var lookupItems = window.showModalDialog(url,"488px,498px");
alert(lookupItems.items[0].id);
}

to simulate this in webbrowser, I put the corresponding url in
webbrowser.url.

So when called inside web browser, pressing the Ok button does nothing but
having the IE explorer warning 'the application is trying to close the
Windows, do youn want to continue' (or something similar in english,
translating from french).
If I accept, the windows is not closed, I would also xpect to get the
result: lookupItems.items[0].id ?

CS
 
S

Steven Cheng[MSFT]

Thanks for your reply CS,

So for the opened page(show in modal dialog browser windows), that's the
script code you used to close it?

Here is a web thread discussing on registering some script for opening
modaldialog and return result to parent page in ASP.NET:

http://www.eggheadcafe.com/articles/20050319.asp

You can also have a test to see whether it works.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,153
Latest member
NamKaufman
Top