主页面内的ASP页面

时间:2015-03-27 11:08:42

标签: asp-classic iis-7.5

所以我使用主索引页面,所有" main"链接& css styles。

然后我有其他.asp页面只有行代码,我通过索引页面显示这些页面:

Dim strPage
strPage = Request.QueryString("show")
If Len(strPage) = 0 Then
Server.execute("sign-in.asp")
Else
Server.execute(strPage & ".asp")
End if

所以,如果我去http://8.8.8.8/?show=start

它将显示start.asp以及从index.asp页面获取的样式等。 但我注意到,我的网页正在加载AGES。 在localhost /?show = start上预览它真棒和快。但是很快就会公开。地狱慢了。所以看起来这个代码在某种程度上减慢了我的页面,是否有一些编辑我可以做或正确配置我的IIS以更好地处理这个?

(当我删除了这个并在每个页面上添加链接,css等时,它加载的速度更快,就像它是localhost一样,但我不能用它,因为我编辑" main&# 34;链接和CSS很多。我只想在1页上编辑它们。)

1 个答案:

答案 0 :(得分:0)

如果您希望有多个页面(而不是一个index.asp页面),但只有一个文件可以编辑样式和其他常规设置,最好的方法是在所有页面上包含一个设置文件,如下所示

" setting.asp"的样本来源:

<style>
/*general styles goes here*/
</style>
<script src="setting.js"></script>
// and other general setting including js file and css files goes here

这是index.asp的示例源:

<html>
<!--#include file="setting.asp"-->
//index codes here..
</html>

这是signin.asp的示例源:

<html>
<!--#include file="setting.asp"-->
//signin codes here..
</html>