包含文件的问题! [英] Problem with include files!

查看:55
本文介绍了包含文件的问题!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我是ASP的新手,我正在尝试对某些ASP 3.0代码进行一些更改

我继承了。


我有一些以VBS为基本语言的ASP页面,每一个

这些页面我已经成功地包含了一段VBS代码

通过使用以下方式在表格单元格中生成输出:


<! - #include file =" showAnswers.inc" - >


我在网站上添加了一个新页面,其中基本语言是

JavaScript。如果我尝试在那里使用相同的include行,它就不会工作

,因为它正确检测到包含文件中的代码是用
VBScript而不是JavaScript编写的。


所以我试过......


< Script language =" VBScript" SRC =" showAnswers.inc" < / Script>


该页面在浏览器中运行时没有错误,但包含

文件中的代码并不包括在内,所以我不知道得到我期望的输出。


所以我试试......

< Script language =" VBScript" SRC =" showAnswers.inc" RUNAT =" server">< / Script>


包含现在有效,但所包含代码的输出显示在

顶部输出,而不是我想要它的表格单元格。


我不知道如何解决这个问题。任何人都可以帮忙吗?


谢谢

Jules

Hello,

I am new to ASP and am trying to make some changes to some ASP 3.0 code
I have inherited.

I have a number of ASP pages with VBS as the base language, on each of
these pages I have successfully included a piece of VBS code that
produces output in a table cell by using:

<!--#include file="showAnswers.inc" -->

I have added a new page to the site where the base language is
JavaScript. If I try to use the same include line there it doesn''t work
as it correctly detects that the code in the include file is written in
VBScript not JavaScript.

So I tried...

<Script language="VBScript" src="showAnswers.inc" </Script>

The page runs in the browser without error but the code in the include
file isn''t included so I don''t get the output I expect.

So i try...
<Script language="VBScript" src="showAnswers.inc" RUNAT="server"></Script>

The include now works but the output of the included code appears at the
top of the output, not in the table cell where I want it.

I have no idea how to resolve this. Can anyone help?

Thanks
Jules

推荐答案

很奇怪。我现在遇到了同样的问题。我的一些包括工作,并且

有些不是。

i将相同的文件移动到子网站中,然后他们在那里工作。

想知道什么这就是它。


" Julesh" < CA ************** @ hotmail.com>在消息中写道

新闻:Dh ******************* @ fe3.news.blueyonder.co。 uk ...
weird. i have now run into the same problem. some of my includes work, and
some are not.
i moved the same files into a subweb, and they work there.
wondering what''s up with that.

"Julesh" <ca**************@hotmail.com> wrote in message
news:Dh*******************@fe3.news.blueyonder.co. uk...
你好,

我是ASP的新手,我正在尝试对我继承的一些ASP 3.0代码进行一些更改。

我有许多以VBS为基本语言的ASP页面,在这些页面的每一页上我都成功地包含了一段VBS代码,它通过使用表单元格生成
输出:

<! - #include file =" showAnswers.inc" - >

我在基本语言是JavaScript的网站上添加了一个新页面。
如果我尝试使用相同的包含行,那么它就不会像它一样工作
正确检测到包含文件中的代码是用VBScript编写的
而不是JavaScript。

所以我试过......

<脚本语言= QUOT; VBScript的" SRC =" showAnswers.inc" < / Script>

页面在浏览器中运行没有错误,但包含
文件中的代码不包括在内,所以我没有得到我期望的输出。 br />
所以我试试......

< Script language =" VBScript" SRC =" showAnswers.inc" RUNAT =" server">< / Script>

包含现在有效,但所包含代码的输出显示在输出的顶部,而不是表格单元格中我想要它。

我不知道如何解决这个问题。有人可以帮忙吗?

谢谢

Jules
Hello,

I am new to ASP and am trying to make some changes to some ASP 3.0 code I
have inherited.

I have a number of ASP pages with VBS as the base language, on each of
these pages I have successfully included a piece of VBS code that produces
output in a table cell by using:

<!--#include file="showAnswers.inc" -->

I have added a new page to the site where the base language is JavaScript.
If I try to use the same include line there it doesn''t work as it
correctly detects that the code in the include file is written in VBScript
not JavaScript.

So I tried...

<Script language="VBScript" src="showAnswers.inc" </Script>

The page runs in the browser without error but the code in the include
file isn''t included so I don''t get the output I expect.

So i try...
<Script language="VBScript" src="showAnswers.inc" RUNAT="server"></Script>

The include now works but the output of the included code appears at the
top of the output, not in the table cell where I want it.

I have no idea how to resolve this. Can anyone help?

Thanks
Jules



好吧,

混合服务器端javascript和vbscript在同一代码中很少很好

想法


你的学习

最好坚持我说的一个或者另一个..


我混淆了这两个并且只有非常简单的东西才能上瘾。

充其量正常工作


" Julesh" < CA ************** @ hotmail.com>在消息中写道

新闻:Dh ******************* @ fe3.news.blueyonder.co。 uk ...
well,

mixing server side javascript and vbscript in the same code is seldom a good
idea

your learning that

best to stick to one or the other I say..

I have fooled around with mixing the two and only got very simple things to
work correctly at best


"Julesh" <ca**************@hotmail.com> wrote in message
news:Dh*******************@fe3.news.blueyonder.co. uk...
你好,

我是ASP的新手,我正在尝试对我继承的一些ASP 3.0代码进行一些更改。

我有许多以VBS为基本语言的ASP页面,在这些页面的每一页上我都成功地包含了一段VBS代码,它通过使用表单元格生成
输出:

<! - #include file =" showAnswers.inc" - >

我在基本语言是JavaScript的网站上添加了一个新页面。
如果我尝试使用相同的包含行,那么它就不会像它一样工作
正确检测到包含文件中的代码是用VBScript编写的
而不是JavaScript。

所以我试过......

<脚本语言= QUOT; VBScript的" SRC =" showAnswers.inc" < / Script>

页面在浏览器中运行没有错误,但包含
文件中的代码不包括在内,所以我没有得到我期望的输出。 br />
所以我试试......

< Script language =" VBScript" SRC =" showAnswers.inc" RUNAT =" server">< / Script>

包含现在有效,但所包含代码的输出显示在输出的顶部,而不是表格单元格中我想要它。

我不知道如何解决这个问题。有人可以帮忙吗?

谢谢

Jules
Hello,

I am new to ASP and am trying to make some changes to some ASP 3.0 code I
have inherited.

I have a number of ASP pages with VBS as the base language, on each of
these pages I have successfully included a piece of VBS code that produces
output in a table cell by using:

<!--#include file="showAnswers.inc" -->

I have added a new page to the site where the base language is JavaScript.
If I try to use the same include line there it doesn''t work as it
correctly detects that the code in the include file is written in VBScript
not JavaScript.

So I tried...

<Script language="VBScript" src="showAnswers.inc" </Script>

The page runs in the browser without error but the code in the include
file isn''t included so I don''t get the output I expect.

So i try...
<Script language="VBScript" src="showAnswers.inc" RUNAT="server"></Script>

The include now works but the output of the included code appears at the
top of the output, not in the table cell where I want it.

I have no idea how to resolve this. Can anyone help?

Thanks
Jules





" ; Julesh" < CA ************** @ hotmail.com>在消息中写道

新闻:Dh ******************* @ fe3.news.blueyonder.co。 uk ...

"Julesh" <ca**************@hotmail.com> wrote in message
news:Dh*******************@fe3.news.blueyonder.co. uk...
您好,

我是ASP的新手,我正在尝试对某些ASP 3.0代码进行一些更改
我继承了。

我有许多以VBS为基本语言的ASP页面,在这些页面的每一页上我都成功地包含了一段VBS代码,它通过使用在表格单元格中生成输出:

<! - #include file =" showAnswers.inc" - >


原始开发项目的设计选择很差。

我在基础语言所在的网站上添加了一个新页面
JavaScript。如果我尝试使用相同的include行,那就不行了,因为它正确检测到包含文件中的代码是用VBScript而不是JavaScript编写的。

所以我试过......

< Script language =" VBScript" SRC =" showAnswers.inc" < / Script>


这只是试图在客户端上运行include的内容。 (使用

inc扩展允许客户端下载另一个可怜的

选项的文件内容。)

页面在浏览器中运行时没有错误但是包含
文件中的代码并不包括在内,所以我没有得到我期望的输出。

所以我试试......

< Script language =" VBScript" SRC =" showAnswers.inc" RUNAT =" server">< / Script>


我很惊讶这个有用。通常不可能使用ASP

包含作为VBScript源,这包括可能至少有一个< %%>在VBScript中无效的分隔符。为了这个

工作这些分隔符需要被删除,但随后所有其他

正常使用的包含将会中断。


当指定的语言

与页面语言不同时,此方法还有另一个问题。内容不会在

行中执行,但会在页面的其余部分处理之前执行。

包含现在有效,但所包含代码的输出显示在输出的顶部,而不是我想要的表格单元格。

我不知道如何解决这个问题。有人可以帮忙吗?


最简单的解决方案是停止使用JScript作为基础语言。


如果你真的必须使用JScript那么只有我可以看到的解决方案是将

页面保留为VBScript并将所有JScript放在: -


< script language =" JScript" runat =" Server">

..

..

..

< / script> ;


阻止在页面顶部。请注意,这应该包含纯Jscript,

没有内联HTML,任何生成响应输出的代码都应该是函数内部的
。然后,您可以在需要的时候从页面VBScript

语言调用这些函数。


Anthony。

谢谢

Jules
Hello,

I am new to ASP and am trying to make some changes to some ASP 3.0 code
I have inherited.

I have a number of ASP pages with VBS as the base language, on each of
these pages I have successfully included a piece of VBS code that
produces output in a table cell by using:

<!--#include file="showAnswers.inc" -->

A poor design choice on the part of the original development.
I have added a new page to the site where the base language is
JavaScript. If I try to use the same include line there it doesn''t work
as it correctly detects that the code in the include file is written in
VBScript not JavaScript.

So I tried...

<Script language="VBScript" src="showAnswers.inc" </Script>

This just tries to run the contents of the include on the client. (Use of
inc extension allows the client to download the file content another poor
choice.)
The page runs in the browser without error but the code in the include
file isn''t included so I don''t get the output I expect.

So i try...
<Script language="VBScript" src="showAnswers.inc" RUNAT="server"></Script>

I''m suprised this works at all. It normally isn''t possible to use an ASP
include as a VBScript source, this include is likely to at least have a
couple of <% %> delimiters which are invalid in VBScript. In order to this
to work these delimiters would need to be removed but then all the other
normal uses of the include would break.

There is another problem with this approach when the specified language
isn''t the same as the page language. The content will not be executed in
line but will executed before the rest of the page has been processed.
The include now works but the output of the included code appears at the
top of the output, not in the table cell where I want it.

I have no idea how to resolve this. Can anyone help?

The easiest solution is to stop using JScript as your base language.

If you really must use JScript then the only solution I can see is leave the
page as VBScript and place all your JScript in a:-

<script language="JScript" runat="Server">
..
..
..
</script>

block at the top of your page. Note that this should contain pure Jscript,
no inline HTML, also any code that generates output to the response should
be inside functions. You then call the functions from the pages VBScript
language at the point you need them.

Anthony.


Thanks
Jules



这篇关于包含文件的问题!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆