Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IE WebBrowser control SaveAs dialog
Message
De
11/11/2007 12:06:38
 
 
À
11/11/2007 01:49:13
Information générale
Forum:
ASP.NET
Catégorie:
Controls activeX
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01268326
Message ID:
01268347
Vues:
10
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform