473,383 Members | 1,822 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,383 software developers and data experts.

Accessing html element or client side javascript object from C#.

Hi,
I am developing desktop application. In the desktop application am loading a
html page, i want to acces html element value from C# code.
Can anyone help me? how to access a html element or clientside javascript
object from C# code.

Note: i am not using web server.

TIA,

Gary
Nov 15 '05 #1
2 11274
Gary,

If you are hosting the web browser control that is showing the HTML,
then the control exposes a document property that you can use to get the
IHTMLDocument2 interface that represents the DOM of the HTML document. Once
you have this, you can access the document in any way that you wish.

You might want to add a reference to MSHTML.TLB in order to get the
types that you can access in the DOM.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Gary" <ms****@microsoft.com> wrote in message
news:O8**************@tk2msftngp13.phx.gbl...
Hi,
I am developing desktop application. In the desktop application am loading a html page, i want to acces html element value from C# code.
Can anyone help me? how to access a html element or clientside javascript
object from C# code.

Note: i am not using web server.

TIA,

Gary

Nov 15 '05 #2
Thanks a lot, Nicholas.
- Gary

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote
in message news:OS**************@TK2MSFTNGP11.phx.gbl...
Gary,

If you are hosting the web browser control that is showing the HTML,
then the control exposes a document property that you can use to get the
IHTMLDocument2 interface that represents the DOM of the HTML document. Once you have this, you can access the document in any way that you wish.

You might want to add a reference to MSHTML.TLB in order to get the
types that you can access in the DOM.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Gary" <ms****@microsoft.com> wrote in message
news:O8**************@tk2msftngp13.phx.gbl...
Hi,
I am developing desktop application. In the desktop application am loading
a
html page, i want to acces html element value from C# code.
Can anyone help me? how to access a html element or clientside

javascript object from C# code.

Note: i am not using web server.

TIA,

Gary


Nov 15 '05 #3

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

Similar topics

8
by: Frank Ratzlow | last post by:
Hi folks, I have a list of entries where some entries contain the special character (quotes) within in the string. If I try to save this entry everything after the quotes is skipped. The reason...
5
by: KathyB | last post by:
If someone could just explain this to me...I just don't get it! I have an aspx page where I retrieve several session variables and use xmlDocument to transform xml file with xsl file into an...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
1
by: Salek Talangi | last post by:
Hello, I have following (probably very basic) problem: I made a html-frameset in VS.net, where the frames itself are aspx-pages with webforms. Now I want to access the webforms (eg. give a label...
1
by: CS Wong | last post by:
Hi, I have a page form where form elements are created dynamically using Javascript instead of programatically at the code-behind level. I have problems accessing the dynamically-created...
0
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
9
by: Phil_Harvey | last post by:
I am redoing my website and trying to get it to do something more exciting using Javascript. I did normal Java at university and code at work in VB.NET. I have got reasonably far into what I want...
3
by: rolf.oltmans | last post by:
Hello, I've been trying to access the html element "Body" in my server side code. I've searched the archives of this group and have been able to put together an example that doesn't work :)...
5
by: thisis | last post by:
Hi All, Hi All, (this is not the same topic as the my previous topic) What objects/methods/properties does VBScript offer for: Assuring/guarantee/make certain that ASP/VBSCript an ELEMENT...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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...

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.