Disable Save Dialog In Webbrowser Editing

A few days back, I have got a call from one of my friend who was facing a problem related to Webbrowser Windows Application control. The problem was unwanted save dialog on a load of the new document to Webbrowser control. It was showing unwanted save dialog box with 3 options i.e. the document has been modified. Do you want to save the changes? Yes/No/Cancel

After a lot of RND, I have got the solution. You have to add the following line before loading any file to Webbrowser control and after that, the Save dialog will not prompt.

WebBrowser1.Document.ExecCommand(“Refresh”, False, “”)

Enjoy Coding..!!

Posted in:

Leave a Reply