Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1374
  • Last Modified:


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?

Frederick Volking
1 Solution
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.
volkingAuthor Commented:
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 ...

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 (, YATT ( and Ethereal ( 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.
stick this javascript function in your page:

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

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.

volkingAuthor Commented:
Here's what I finally got to work .....

In the <HEAD> section add this javascript

     <script language="javascript">
     function viewSource()

Then, anyplace in the <BODY> add this.

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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now