how do i make a view source?

Results 1 to 3 of 3

Thread: how do i make a view source?

  1. #1
    Join Date
    Dec 1969

    Default how do i make a view source?

    how do i make a view aource to the page i am currently working in? i ´don´t know how to do this<BR><BR>thanks<BR>david

  2. #2
    simple Guest

    Default RE: how do i make a view source?

    right click on the page and select view source.or select View and chose source

  3. #3
    Join Date
    Dec 1969

    Default fso - View Source

    Here&#039s the function that will do it for you:<BR><BR>Function ViewSource(filepath)<BR>Dim objFSO, objTStream, strText<BR>Const ForReading = 1<BR><BR>&nbsp;&nbsp;Set objFSO = Server.CreateObject("Scripting.FileSystemObject")< BR>&nbsp;&nbsp;Set objTStream = objFSO.OpenTextFile(filepath, ForReading)<BR><BR>&nbsp;&nbsp;strText = objTStream.ReadAll<BR>&nbsp;&nbsp;strText = Replace(strText, "&#060;", "&amp;lt;")<BR><BR>Set objTStream = Nothing<BR>Set objFSO = Nothing<BR><BR>ViewSource = strText<BR>End Function<BR><BR>And here&#039s how you would call it:<BR><BR>Response.Write "&#060;pre&#062;" & ViewSource(Server.MapPath("YourFile.html")) & "&#060;/pre&#062;"<BR><BR>If you are actually wanting the file that you are currently viewing then you will need to use Server.MapPath with a Request.ServerVariables variable to get the page URL.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts