473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

System.Windows.Forms.HtmlDocument and mshtml.HTMLDocument


Hi,

VS2005, C#

I have developed a UserControl embedded in a HTML web page. And I can
access to the DOM with the following code:

HTML page:

……..
<BODY onload=loadDoc()>
…….
<script type="text/javascript">

function loadDoc()
{
//passing the document as a parameter to our UserControl
document.form1.myobject.doc = document;
}

</script>
….

C# User control:

private mshtml.HTMLDocument DocVal;

public mshtml.HTMLDocument Doc
{
get { return DocVal; }
set
{
DocVal = value;
}
}
Fine, perfect I can access to the DOM!!
Problem Microsoft has dropped this control from the .net2 framework. And all
the indications are to use: System.Windows.Forms.HtmlDocument.

Ok fine even better I can get rid off the interop I thought, but when I
replace mshtml.HTMLDocument with System.Windows.Forms.HtmlDocument, so:

private System.Windows.Forms.HtmlDocument DocVal;

public System.Windows.Forms.HtmlDocument Doc
{
get { return DocVal; }
set
{
DocVal = value;
}
}


Internet Explorer throw an error saying: Error class does not support
automation!

in the line: document.form1.myobject.doc = document;
Any suggestions on how to use System.Windows.Forms.HtmlDocument ?

Many thanks,
Filippo

Mar 13 '06 #1
0 1765

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Rausch | last post by:
I have a browser component placed in my Windows form. I have a reference to mshtml. All aspects of the browser (events, navigation, etc.) seem to work fine. I am creating an instance of the...
3
by: James Dixon | last post by:
I have created a windows service in C#, .net framework 1.1 The service makes a web request using the mshtml.HTMLDocument.CreateDocumentFromURL() function Because this is not using...
7
by: Robert May | last post by:
I have an application that uses the Ax web browser object. When I call the IHTMLElement.click() method on an input button (<input type="submit"> or <input type="button">), the click fires...
8
by: pierre | last post by:
Hi, I got a problem which may easy to resolve, but I can't find any issue: I want to parse html files, so, I want first get it from an url, and I do like that: Dim objMSHTML As New...
8
by: copyco | last post by:
Is there a way to display formatted HTML in a Windows form? Or can I dynamically create an HTML file and then display that from a Windows Application? I can create a new HTML file in my project,...
0
by: Filippo Bettinaglio | last post by:
VS2005, C# I have developed a UserControl embedded in a HTML web page. And I can access to the DOM with the following code: HTML page: …….. <BODY onload=loadDoc()> …….
2
by: Paul Hemans | last post by:
I am very new at .Net. I have a small project where I need to manipulate the contents of a web page. I have a form with a web browser control (webBrowser1) on it. Within the...
0
by: Lambuz | last post by:
Hi all, I've got this problem. I've to implemente a solution like the example in http://support.microsoft.com/default.aspx?scid=kb;EN-US;313891, but I can't configure correctly the example. ...
0
by: nickin4u | last post by:
I have a application that is used to automate certain task, I have been using mshtml.HTMLDocument class but certain events like click a button do not fire. I have tried a number of combinations but...
0
by: =?Utf-8?B?Q29kZVJhem9y?= | last post by:
I am converting a windows application which contains a web browser control into an ASP.net application. The Windows project references all manner of html controls in the WebBrowser control and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.