Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - Software to show complete ASP file with includes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Software to show complete ASP file with includes

 Post Reply Post Reply
Author
UseAsMe View Drop Down
Newbie
Newbie


Joined: 07 September 2012
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote UseAsMe Quote  Post ReplyReply Direct Link To This Post Topic: Software to show complete ASP file with includes
    Posted: 07 September 2012 at 10:27am
This is what i used to do:
Rename your first .asp file to .ssi.
 
ssi uses the same syntax for includes as .asp but will not parse your asp code.
Back to Top
aussiem8 View Drop Down
Groupie
Groupie


Joined: 23 February 2012
Status: Offline
Points: 55
Post Options Post Options   Thanks (0) Thanks(0)   Quote aussiem8 Quote  Post ReplyReply Direct Link To This Post Posted: 27 April 2012 at 12:42pm
I've found some code that I modified a little to show me includes only for my site (plus with one level of nesting). 

No doubt you experienced programmers can improve on it (eg. to also show css stylesheets, deeper nested includes, open dialog box to select the file, etc.)

<%
' Target page to be read
'page_to_read = "webpage.asp"

' Create a server object
set fso = createobject("scripting.filesystemobject")

' Set the path to document to be read
set act = fso.opentextfile(server.mappath(page_to_read))

' Read the contents of the document to the
' read_text variable

'Start the page output
response.write "<pre>"

do
read_text = act.readline

'If include link exists, read that file and output
If left(read_text,20) = "<!-- #include file=""" then

    IncludeFileName = mid(read_text,21,InStr(read_text,".asp")-17)
    'Response.Write ("Filename: " & IncludeFileName)
    'ShowInclude(IncludeFileName)
   
    response.write "</br>####################################################</br>Start of Include: " & IncludeFileName & "</br>####################################################</br></br>"
    'response.write "</br>####################################################</br>Start of Include: " & IncludeFileName & "</br></br>"
    ShowInclude(IncludeFileName)
    'response.write server.htmlencode(read_text) & "</br>"
    response.write "</br>####################################################</br>End of Include: " & IncludeFileName & "</br>####################################################</br></br></br></br>"
    'response.write "</br></br>End of Include: " & IncludeFileName & "</br>####################################################</br></br></br></br>"

Else   
    response.write server.htmlencode(read_text) & "</br>"
End If

Loop Until act.AtEndOfStream

'Close pre tag
response.write "</pre>"

' Close the server object
act.close
%>

<%
Sub ShowInclude(IncludeFileName)
' Target page to be read
page_to_read2=IncludeFileName

' Create a server object
set fso2 = createobject("scripting.filesystemobject")

' Set the path to document to be read
set act2 = fso2.opentextfile(server.mappath(page_to_read2))

' Read the contents of the document to the
' read_text variable

read_text2 = act2.readall

' Close the server object
act2.close

' Write the inputted text out to the browser
' and html encode it to display as source
' enclosed in <pre> tags to display as read
response.write "<pre>" & server.htmlencode(read_text2) & "</pre>"

End Sub
%>

If anyone has a better solution/software recommendation, I'd be keen to know.
Back to Top
aussiem8 View Drop Down
Groupie
Groupie


Joined: 23 February 2012
Status: Offline
Points: 55
Post Options Post Options   Thanks (0) Thanks(0)   Quote aussiem8 Quote  Post ReplyReply Direct Link To This Post Posted: 17 April 2012 at 5:34pm
Hi guys

Reasonably new to ASP and have been wondering for a while now whether there is software that can show the full ASP code by "importing" includes to make it easier to debug programming errors.  What I mean here is that the contents of include files are expanded within the original ASP file, so you can see the entire code as the browser would interpret it.

I know I could cut and past manually, but this can take ages if you have long scripts to debug.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.