473,568 Members | 2,939 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can you use mshtml DOM object to grab rendered asp.net page?

I know how to use MSHTML to grab the innerhtml from an html web page, but
what if I want to look at elements of a rendered aspx page? Is there any
way to do this using the MSHTML DOM object?

Thanks,

Randall Arnold
Dec 29 '05 #1
24 2965
"One" alternative is to use an http handler. This example
will get you off to a good start.

http://www.eggheadcafe.com/articles/hijacksession.asp

--
Robbe Morris - 2004/2005 Microsoft MVP C#
http://www.eggheadcafe.com/forums/merit.asp

"Randall Arnold" <ra************ @nokia.com> wrote in message
news:uG******** ******@tk2msftn gp13.phx.gbl...
I know how to use MSHTML to grab the innerhtml from an html web page, but
what if I want to look at elements of a rendered aspx page? Is there any
way to do this using the MSHTML DOM object?

Thanks,

Randall Arnold

Dec 29 '05 #2
Thanks Robbe. C# makes this VB developer's head spin, and I'm obviously out
of my league based on what I've perused so far, but I'll see if I can get
anything useable out of your well-written article.

I thought this was going to be simple when I started... hoo boy... : (

Randall

"Robbe Morris [C# MVP]" <in**@eggheadca fe.com> wrote in message
news:eU******** *****@TK2MSFTNG P15.phx.gbl...
"One" alternative is to use an http handler. This example
will get you off to a good start.

http://www.eggheadcafe.com/articles/hijacksession.asp

--
Robbe Morris - 2004/2005 Microsoft MVP C#
http://www.eggheadcafe.com/forums/merit.asp

"Randall Arnold" <ra************ @nokia.com> wrote in message
news:uG******** ******@tk2msftn gp13.phx.gbl...
I know how to use MSHTML to grab the innerhtml from an html web page, but
what if I want to look at elements of a rendered aspx page? Is there any
way to do this using the MSHTML DOM object?

Thanks,

Randall Arnold


Dec 29 '05 #3
Robbe Morris [C# MVP] wrote:
"One" alternative is to use an http handler. This example
will get you off to a good start.

http://www.eggheadcafe.com/articles/hijacksession.asp


A better choice would be to use a Response filter.

http://weblogs.asp.net/despos/archiv...01/145436.aspx

--
Jim Cheshire
=============== =============== ==
Blog: http://blogs.msdn.com/jamesche

Latest entry: Digging into Objects
Describes the details of digging into
memory usage with the debugger.

Dec 29 '05 #4
Um, but what about this comment (from the link):

"The problem is that the response's output stream is write-only, presumably
for performance reasons. Any attempt to read the output stream fails"

Basically, I want to grab a table rendered by the asp.net code and copy it
to the clipboard. So far all suggested methods have failed. I'm sure what
I want to do *HAS* to be possible... just can't find out how...

Randall

"Jim Cheshire" <no*****@none.c om> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Robbe Morris [C# MVP] wrote:
"One" alternative is to use an http handler. This example
will get you off to a good start.

http://www.eggheadcafe.com/articles/hijacksession.asp


A better choice would be to use a Response filter.

http://weblogs.asp.net/despos/archiv...01/145436.aspx

--
Jim Cheshire
=============== =============== ==
Blog: http://blogs.msdn.com/jamesche

Latest entry: Digging into Objects
Describes the details of digging into
memory usage with the debugger.

Dec 29 '05 #5
Randall Arnold wrote:
Um, but what about this comment (from the link):

"The problem is that the response's output stream is write-only,
presumably for performance reasons. Any attempt to read the output
stream fails"

That comment applies to the PreSendRequestC ontent and not to a response
filter.

Basically, I want to grab a table rendered by the asp.net code and
copy it to the clipboard. So far all suggested methods have failed. I'm
sure what I want to do *HAS* to be possible... just can't find
out how...


I would seriously reconsider that desire. What is it that you are trying to
accomplish?

--
Jim Cheshire
=============== =============== ==
Blog: http://blogs.msdn.com/jamesche

Latest entry: Digging into Objects
Describes the details of digging into
memory usage with the debugger.

Dec 29 '05 #6
This is the gist of it: our organization currently uses a VB6 program to
track and report quality issues. The developer is long gone and I have no
access to current source code.

I've been tasked to develop a new solution and the preference is web-based.
To that extent, I selected asp.net based on my experience with vb and
vb.net.

Users will view tables and charts on the intranet site and need to have the
ability to publish them in other applications (Word, Powerpoint, Publisher,
et al). I can easily copy the charts to any app because the chart object
has a method that creates bitmaps or metafiles on the fly, and even though
I'd rather copy the actual chart object, this will suffice.

The problem arises with copying tabular info. I've exhausted numerous ideas
and not one single one has worked unless it involves saving the table to an
html file, loading it in Word, copying the resulting table to the clipboard,
and pasting it. That's just plain nuts IMO. I can't understand why I can't
simply programmaticall y access the rendered html table, especially since I
can highlight it with a mouse, copy, paste and done. I should be able to
emulate that action in vb.net code, right? If I can't *I* have serious
reservations about the maturity level of asp.net.

Randall

"Jim Cheshire" <no*****@none.c om> wrote in message
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
Randall Arnold wrote:
Um, but what about this comment (from the link):

"The problem is that the response's output stream is write-only,
presumably for performance reasons. Any attempt to read the output
stream fails"

That comment applies to the PreSendRequestC ontent and not to a response
filter.

Basically, I want to grab a table rendered by the asp.net code and
copy it to the clipboard. So far all suggested methods have failed. I'm
sure what I want to do *HAS* to be possible... just can't find
out how...


I would seriously reconsider that desire. What is it that you are trying
to accomplish?

--
Jim Cheshire
=============== =============== ==
Blog: http://blogs.msdn.com/jamesche

Latest entry: Digging into Objects
Describes the details of digging into
memory usage with the debugger.

Dec 29 '05 #7
Randall Arnold wrote:
I can't understand why I can't simply programmaticall y
access the rendered html table, especially since I can highlight it
with a mouse, copy, paste and done. I should be able to emulate that
action in vb.net code, right? If I can't *I* have serious
reservations about the maturity level of asp.net.
Randall


I went back and read your original post. It seems that you want to copy this
to the client clipboard. Is that correct? If so, can't be done in ASP.NET.
ASP.NET code doesn't execute on the client.

--
Jim Cheshire
=============== =============== ==
Blog: http://blogs.msdn.com/jamesche

Latest entry: Digging into Objects
Describes the details of digging into
memory usage with the debugger.

Dec 30 '05 #8
Ok, I can understand that, but with all due respect I still can't accept
that I can't achieve this one way or another. Again, I have no problem
copying the chart graphic to the clipboard and bringing it into PowerPoint
with 2 simple lines of code, and it looks beautiful. I have to believe that
there is *some* way of copying a simple table over as well, without going
through contortions. I keep seeing hints that it can be done but either the
methods don't work for me or there aren't enough details provided. Someone
told me there's a way to stream the table to PowerPoint but provided no
other info. ???

Right now the 2 options I know I can use are the cumbersome html file
generation technique and building each and every table from scratch in
PowerPoint using vba with the interop. I have issues with either approach,
but I'll use the former if I have no other choice. MUCH less code.

The thing that gets me is I found an asp.net/JavaScript combo trick that
allows the user to toggle a table between hidden and visible. I got this to
work on the page in question. If I can do THAT, I have to believe I can use
a similar trick to copy the table. I just need to know the method.

Randall Arnold

"Jim Cheshire" <no*****@none.c om> wrote in message
news:eO******** ******@TK2MSFTN GP10.phx.gbl...
Randall Arnold wrote:
I can't understand why I can't simply programmaticall y
access the rendered html table, especially since I can highlight it
with a mouse, copy, paste and done. I should be able to emulate that
action in vb.net code, right? If I can't *I* have serious
reservations about the maturity level of asp.net.
Randall


I went back and read your original post. It seems that you want to copy
this to the client clipboard. Is that correct? If so, can't be done in
ASP.NET. ASP.NET code doesn't execute on the client.

--
Jim Cheshire
=============== =============== ==
Blog: http://blogs.msdn.com/jamesche

Latest entry: Digging into Objects
Describes the details of digging into
memory usage with the debugger.

Dec 30 '05 #9
Randall Arnold wrote:

The thing that gets me is I found an asp.net/JavaScript combo trick
that allows the user to toggle a table between hidden and visible. I
got this to work on the page in question. If I can do THAT, I have
to believe I can use a similar trick to copy the table. I just need
to know the method.


This is not an ASP.NET question. It is a question concerning client-script.
A quick Google search on "javascript clipboard" reveals thousands of hits.

I have to say as well that if you don't get your head around the fact that
ASP.NET is server side code with no connection to the client, you're going
to be quite confused as your development continues. This is the basic
foundation of ASP.NET and it's something that every ASP.NET absolutely must
know.

--
Jim Cheshire
=============== =============== ==
Blog: http://blogs.msdn.com/jamesche

Latest entry: Digging into Objects
Describes the details of digging into
memory usage with the debugger.

Dec 30 '05 #10

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

Similar topics

10
44449
by: Atul | last post by:
Hi, I just stepped into C#. I am facing one problem. Here is the scenario. I am posting some data to one website (https site). It returns me response HTML. I want to parse this HTML and want to look for some specific tags. To achieve the same, I wanted to use MSHTMLs HTMLDocumentClass Interface. I dont know how to use it in C#. I am using...
4
17623
by: David Pendrey | last post by:
Hello all, I am using the WebBrowser control to browse a webpage containing frames and am having difficulties accessing the 'frames' property of a document object. Bellow is my code and the error recieved: webAccess.Navigate(URL); // Wait until document is loaded. This part DOES work IHTMLDocument2 mDoc =...
2
3754
by: DotNetShadow | last post by:
Hi Guys, I have been reading heaps of information in regards to MSHTML object being used in .NET applications, windows and UI-less. I have read the walkall samples and tried various techniques with MSHTML. My biggest problem seems to be running MSHTML in asp.net application and looping elements in the document. Example:
4
3285
by: Lars-Erik Aabech | last post by:
Hi! I've been walking in extacy since reading the article about test automation with IE in the latest MSDN mag. (http://msdn.microsoft.com/msdnmag/issues/05/10/TestRun/default.aspx) After a while, I had to find an issue I couldn't solve. (Of course) If an ASP.NET page uses the smartnav option, the document you get from IE only contains...
3
2752
by: DotNetShadow | last post by:
Hi Guys, I have been reading heaps of information in regards to MSHTML object being used in .NET applications, windows and UI-less. I have read the walkall samples and tried various techniques with MSHTML. My biggest problem seems to be running MSHTML in asp.net application and looping elements in the document. Example:
2
3285
by: J Williams | last post by:
I'm using the WebBrowser control and mshtml library to modify the HTML in a web page. E.g. the code below is meant to change all .txt links to .zip, but doesn't because mAnchorElement is just a copy of mElement and doesn't reference mElement and any changes I make to it affect the copy and not mElement. Private Sub...
11
2350
by: Lucky | last post by:
hi guys, i need to parse html data that i've got from "Inet" object in vb6. now i want to prase the html data. here i got 2 options. one is MSXML and other is MSHTML. i tried both of them but i didnt get anything out of them. MSXML doesnt works with some keywords and consider some letters as operator so i cant go with MSXML. i tried MSHTML...
0
1536
by: Laurent Lequenne | last post by:
Hello All, I'm currently developing a free windows Scrabble (in french :)) application that uses extensively the WebBrowser class of NET 2.0 for configuration, and data browsing. It works 100% on my machine, with the WebBrowser Class, and the Microsoft.MsHtml component. I can access all elements on the pages through the events, I can change...
0
3560
by: Andy Bates | last post by:
Hi - This issue seems to have been kicking around since the dawn of time and no one appears to have come up with an answer. In short the MHT/MSHTML provides a method of archiving an HTML page into a single MIME encoded file that specifies all of the resources for a page in a single file. This makes a lot of sense as if you could pass...
0
7604
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7660
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6275
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5498
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
932
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.