• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

ASP Include file

S

snyhof

Guest
Can I use an include file in my template. SDK doesn't like it.

<!-- #include file="nav.asp" -->

I have the nav.asp file in the root with the master.page.

I am trying to add a contact info (html only) area below the side nav area that can be edited outside of sitebuilder.

Server Error in '/' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not find file 'C:\Program Files\SWsoft\SiteBuilder for Windows 4.0\SDK\Tools\Web\nav.asp'.

Source Error:


Line 93: <td class="pageTitleNavAddress">
Line 94:
Line 95: <!-- #include file="nav.asp" -->
Line 96: <p><b>
Line 97: MLP Construction, LLC</b><br>


Source File: /Default.master Line: 95


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

--- later ---
I have this working, see below
 
Ok, I figured this out.

I use Dream Weaver to build my templates.

I rename my master.page file to master.page.html to edit the template.

The included file does show up now as expacted.

To view it in the SDK program you need to place the file in..
C:\Program Files\SWsoft\SiteBuilder for Windows 4.0\SDK\Tools\Web\nav.asp

--- Later ---

I tried it online in the Editor and I get an error. Maybe this is not possible. :(

--- Later Still ---

It works in the SDK program because the sample pages are .aspx - The pages online are .html. See below

-------------------------------------------------

New question:
Is there a way to make the default pages .aspx pages when a new site page is made? Seems there must be some setting that could make this work. This could open up more options.
page1.html
page2.html

to:
page1.aspx
page2.aspx
and so forth.
 
include .asp pages

So the question remains...
Is there some way to make the wizard editor show the included page?
 
Hello Steve,
Some sites have html pages since they haven't any dynamic (it means there is no any module at the site). So only static html files get published for this site.
About including any server logic in site - it's prohibited right now for Sitebuilder user (since it's secuirity treat). And there is no possibility to provide server code by administrator neither (Modules SDK is on the way, however it's not ready still).
But you can provide links to another site with the logic you like. To build links into Sitebuilder site you can use following trick:
http://forum.swsoft.com/showthread.php?s=&threadid=47404
 
This is very helpful as this is an answer to one of my questions on another post. Makes sense, didn't think about a redirect.

Is there a solution to the include file? To include another page inside the template?

I want to use an included page to display the users contact info, this makes it easy to change without having to compile and upload the template again.

includecont.jpg


I just tried using an iframe and it all works without errors in the editor, however, now it want a password to display it.
I have put the nav.html file in the root and the iframe is calling it. Do you know why is needs permisson?

I would rather use an include page.
 
Originally posted by Alex Klimov
...haven't any dynamic content

If I add dynamic content - ie. a script, will all my page extentions change to .aspx?

--- Later ---

Ok, that actually works! Drag in the script module and all pages on the site change from .html to .aspx - Great!

So now that I know I can plan on the .aspx extention, can you think of how I can use an included page that works in the Wizard Editor?

It works in the SDK program if I place the included file in the folder...
C:\Program Files\SWsoft\SiteBuilder for Windows 4.0\SDK\Tools\Web\nav.asp

Is there a folder on the server where I can place the nav.asp file when I load the template into the SB Editor? I have tried to put it into the \httpdocs\App_Themes\site folder but that did not work either.
 
Originally posted by snyhof
This is very helpful as this is an answer to one of my questions on another post. Makes sense, didn't think about a redirect.

Is there a solution to the include file? To include another page inside the template?

I want to use an included page to display the users contact info, this makes it easy to change without having to compile and upload the template again.

includecont.jpg


I just tried using an iframe and it all works without errors in the editor, however, now it want a password to display it.
I have put the nav.html file in the root and the iframe is calling it. Do you know why is needs permisson?

I would rather use an include page.

Solution with inlcuding .html files won't work, since Asp.Net ISAPI extension doen's support SSI (Asp.Net has own includes, however they're security treat and prohibited in design template).

However you can try to improve iframe solution. Most probably you trying to link page in iframe from another domain, so you have problems with permissions.
So you should
1. Link iframe relatively to the page on the site.
2. To create page on the site with custom html content, you can use Downlodable Content module (don't forget to hide it from site menu).
I didn't try this solution by myself. Just invented it on my feet :)
 
I was using a page in the root of the same domain for the iframe.

However, I added my nav.asp page to the C:\Program Files\Sitebuilder\Sites\name\nav.asp and now it loads in the wizard editor.

I also published it and it worked.

However as soon as I edited this file with new text I recieved this error...

Server Error in '/' Application.
--------------------------------------------------------------------------------

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

--------------------
Any ideas, I feel like I am very close?

--- Later ---
I think I have more problems. Now I am getting an error when publishing. I will try to redue the template.

--- Later ---

Not sure what happened, I deleted the nav.asp file from the root and the site published. Maybe I'll try nav.html as it is only an included page.
 
Originally posted by Alex Klimov
Solution with inlcuding .html files won't work, since Asp.Net ISAPI extension doen's support SSI (Asp.Net has own includes, however they're security treat and prohibited in design template).

I think I understand what you are saying here about security.

I think I am going to drop this for now.
 
Cant seem to drop this...

The code below will adjust an iframe to fit a page it includes. It's very cool and works everywhere except in the SB Editor.

The file is stored in ../NavContent/nav.html
This allows top level pages as well as pages like the Blog and Photo modulers. Again this all works great in the SDK program. I had to place the file in the C:\Program Files\SWsoft\SiteBuilder for Windows 4.0\SDK\Tools\Web\NavContent\nav.html folder.

I have used and in fact am using javascript in the body without problems. See http://mlpconstruction.com/ - The pictures are generated with javascript.

Any ideas of why the Editor rejects the iframe?

<script type="text/javascript">

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes" //Do not change this - keep as yes

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 36 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids)
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids] : document.getElementById(iframeids)
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

</script>
<iframe id="myframe" allowtransparency="true" src="../NavContent/nav.html" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none;"></iframe>

I want to add that the allowtransparency="true" function inside the iframe is really cool in that it allows the color of the navigation area to show.
 
Maybe this will not work, the Blogger has subfolders which break the code. Of course I could add the file in many sub folders...
../NavContent/1/2/3/4/nav.html that would work with the blog. I think.

The idea of this content would allow users with FTP access or developers to quickly change a users address or email. This would also be a great place for a special offer, or newsletter form. Anything someone would want to show common and updated content.

To further expand it's use, it would be great if there was a hidden link or access point where a user could access this content and update it on the fly.
 
Back
Top