Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IE WebBrowser control SaveAs dialog
Message
From
11/11/2007 12:06:38
 
 
To
11/11/2007 01:49:13
General information
Forum:
ASP.NET
Category:
ActiveX controls
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01268326
Message ID:
01268347
Views:
9
I'm not clear if you're doing this in a WinForm or not. If you're talking about WinForms, then I can help you ... having just done this very same thing a couple of weeks ago.

First, you should use .NET 2.0's new WebBrowser control instead of the old ActiveX one. You also have to use the IHTMLDocment2 interface. The trick is setting a designMode property before you populate the DocumentText property.
        // declarations
	protected IHTMLDocument2 oDocument;
	private System.Windows.Forms.WebBrowser oBrowser = new WebBrowser();

        // "databinding" the control
	this.oBrowser.DocumentText = "";
	this.oDocument = this.oBrowser.Document.DomDocument as IHTMLDocument2;
	this.oDocument.designMode = "On";
	this.oBrowser.DocumentText = this.MyTable.DefaultView[MyPosition][MyColumn].ToString();
Does that help?

~~Bonnie


>Hi,
>I created user control to host IE webbrowser as html editor. I have problem that, if I change content of body.bodyhtml programmatically, webbrowser will prompt AskForSave dialog.
>
>Anyway to prevent the dialog prompted? Or, any other free html editor component?
>
>Thank you



this.oDocument.designMode = "On";
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform