Solved

how to VIEW SOURCE of WEB PAGE DIALOG?

Posted on 2004-08-06
5
1,318 Views
Last Modified: 2009-12-16
We're using Window.ShowModalDialog to open a popup "Web Page Dialog".
We're using IE 6.0

Anyone know a "trick" to VIEW SOURCE of a WebPageDialog?

Thanks
Frederick Volking
0
Comment
Question by:volking
5 Comments
 
LVL 3

Expert Comment

by:hyperslug
ID: 11735917
Well, you can View Source the page that calls it, find the URL that's being called through ShowModalDialog, enter that in and then View Source it.  Sort of indirect but the source HTML can't be secure if you're sending it to the client browser.
0
 
LVL 5

Author Comment

by:volking
ID: 11736239
Hyperslug ... your suggestion does not work for us.

Our popup dialog is actually an ASPX page which (among other things) dynamically generates some javascript during server-postback round-trips as well as pass VarArgs[] between the caller page and poped-up pages. It is the returned postback source which we need to see. So we actually need a way to ...

VIEW SOURCE of a WebPageDialog .... following VarArgs[] transfer and post-back ...
0
 
LVL 2

Expert Comment

by:amg42
ID: 11742270
Frederick,

Do you want to see the source for debugging purposes? If so, you can also trace the HTTP traffic. Maybe a little bit less convenient than heaving the source in your editor, but quite powerful nonetheless.

The tools I use for this kind of thing are TCPTrace (http://www.pocketsoap.com/tcptrace/), YATT (http://www.pocketsoap.com/yatt/) and Ethereal (http://www.ethereal.com/). Ethereal is open source, but they are all free tools.

TCPTrace comes in handy if your client and server are running on the same machine. The other two tools capture packets at the network adapter level, so they won't work in that scenario. All of them work fine if you want to trace the traffic between two machines.

Ethereal "understands" HTTP, so its output can be a little easier to analyse, but the tool in itself is a bit more complex than TCPTrace and YATT. If all you need to do is capture HTTP traffic, I'd say that both TCPTrace and YATT are quite appropriate.
0
 
LVL 1

Accepted Solution

by:
DrZedd earned 500 total points
ID: 11752404
stick this javascript function in your page:

<script language=JavaScript>
function ViewSource() {
      window.location = "view-source:" + window.location.href;
      }
</SCRIPT>

then add a button as follows:

<input type=button value=" View Source " onclick="ViewSource()">

this will open a new window with the page source in it.


0
 
LVL 5

Author Comment

by:volking
ID: 14865493
Here's what I finally got to work .....

In the <HEAD> section add this javascript

     <script language="javascript">
     function viewSource()
          {
                 d=window.open();
                 d.document.open('text/plain').write(document.documentElement.outerHTML);
          }
     </script>

Then, anyplace in the <BODY> add this.

     <input type=button value="View Source" onclick="viewSource()">

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This video teaches users how to migrate an existing Wordpress website to a new domain.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question