Solved

how to VIEW SOURCE of WEB PAGE DIALOG?

Posted on 2004-08-06
5
1,311 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Uploading files to the web server has become common part of almost any kind of web application. People use different technologies to solve this, but regardless of the technology used, it is always useful to have some kind of progress indicator shown…
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:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now