动态创建要包含在响应中的.js文件 [英] Dynamically creating a .js file to be included in response

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

问题描述

我正在创建一个自定义Web控件,它使用属性的枚举

{Remote,InLine}。

如果属性设置为inline,则读取文本从嵌入的

资源中发送到aspx页面中的浏览器作为内联java脚本。

如果属性设置为Remote,则脚本标记设置为SRC <显示< script language =" javascript"

Src =" MyJS.js">< / script> ;.

有没有办法从浏览器捕获传入的请求(对于

< script language =" javascript" src =" myJavaScript.js">< /脚本>

然后动态创建文件,然后返回对文件不存在的

浏览器的响应

谢谢,

Ron。

I am creating a custom web control that uses an enum for a property
{Remote,InLine}.
If the property is set to inline then text is read from the embedded
resource and sent to the browser in the aspx page as inline java script.
If the property is set to Remote then the script tag set with the SRC
attribute is displayed <script language="javascript"
Src="MyJS.js"></script>.

Is there a way to catch an incoming request from the browser (for the
<script language="javascript" src="myJavaScript.js"></script>
And then dynamically create the file before it returns a response to the
browser that the file does not exsit
Thanks,
Ron.

推荐答案




手掌:指定一个aspx在SCRIPT标签的SRC属性中的文件

并在这个aspx文件中动态生成脚本。


-

Dmitriy Lapshin [C#/ .NET MVP]

X-Unity测试工作室
http:// x-unity.miik.com.ua/teststudio.aspx

将单元测试的强大功能带到VS .NET IDE


" Ron Vecchi < RV ***** @ xilehdvecchi.com>在消息中写道

新闻:eE ************** @ TK2MSFTNGP09.phx.gbl ...
Hi,

Sleight of hand: specify an aspx file in the SRC attribute of the SCRIPT tag
and generate the script on the fly in this aspx file.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ron Vecchi" <rv*****@xilehdvecchi.com> wrote in message
news:eE**************@TK2MSFTNGP09.phx.gbl...
我正在创建一个自定义使用enum作为属性的web控件
{Remote,InLine}。
如果属性设置为inline,则从嵌入的
资源中读取文本并将其发送到aspx中的浏览器如果属性设置为Remote,则显示设置了SRC
属性的脚本标记< script language =" javascript"
Src =" MyJS .js">< / script>。

有没有办法从浏览器中捕获传入的请求(对于
< script language =" javascript" src =" ; myJavaScript.js">< / script>
然后动态创建文件,然后返回对文件不存在的
浏览器的响应

谢谢,
Ron。
I am creating a custom web control that uses an enum for a property
{Remote,InLine}.
If the property is set to inline then text is read from the embedded
resource and sent to the browser in the aspx page as inline java script.
If the property is set to Remote then the script tag set with the SRC
attribute is displayed <script language="javascript"
Src="MyJS.js"></script>.

Is there a way to catch an incoming request from the browser (for the
<script language="javascript" src="myJavaScript.js"></script>
And then dynamically create the file before it returns a response to the
browser that the file does not exsit
Thanks,
Ron.









手挽手:指定一个aspx文件在SCRIPT标签的SRC属性中

并在此aspx文件中动态生成脚本。


-

Dmitriy Lapshin [C#/ .NET MVP]

X-Unity测试工作室
http://x-unity.miik.com.ua/teststudio.aspx

将单元测试的强大功能带到VS .NET IDE


" Ron Vecchi" < RV ***** @ xilehdvecchi.com>在消息中写道

新闻:eE ************** @ TK2MSFTNGP09.phx.gbl ...
Hi,

Sleight of hand: specify an aspx file in the SRC attribute of the SCRIPT tag
and generate the script on the fly in this aspx file.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ron Vecchi" <rv*****@xilehdvecchi.com> wrote in message
news:eE**************@TK2MSFTNGP09.phx.gbl...
我正在创建一个自定义使用enum作为属性的web控件
{Remote,InLine}。
如果属性设置为inline,则从嵌入的
资源中读取文本并将其发送到aspx中的浏览器如果属性设置为Remote,则显示设置了SRC
属性的脚本标记< script language =" javascript"
Src =" MyJS .js">< / script>。

有没有办法从浏览器中捕获传入的请求(对于
< script language =" javascript" src =" ; myJavaScript.js">< / script>
然后动态创建文件,然后返回对文件不存在的
浏览器的响应

谢谢,
Ron。
I am creating a custom web control that uses an enum for a property
{Remote,InLine}.
If the property is set to inline then text is read from the embedded
resource and sent to the browser in the aspx page as inline java script.
If the property is set to Remote then the script tag set with the SRC
attribute is displayed <script language="javascript"
Src="MyJS.js"></script>.

Is there a way to catch an incoming request from the browser (for the
<script language="javascript" src="myJavaScript.js"></script>
And then dynamically create the file before it returns a response to the
browser that the file does not exsit
Thanks,
Ron.






一个问题是现在我需要有一个aspx文件沿着

使用我的自定义控件。

我最近注意到了HttpHandlers但是真的不知道是什么

他们是或者如何使用它们。



" Dmitriy Lapshin [C#/ .NET MVP]" < X - **** @ no-spam-please.hotpop.com>在消息新闻中写了

:ev ************** @ TK2MSFTNGP09.phx.gbl ...
One problem with that is that now I would need to have an aspx file along
with my custom control.
I have recently caught notice of HttpHandlers but really don''t know what
they are or how to use them.


"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:ev**************@TK2MSFTNGP09.phx.gbl...

手掌:在SCRIPT
标签的SRC属性中指定一个aspx文件,并在此aspx文件中动态生成脚本。

-
Dmitriy Lapshin [C#/ .NET MVP]
X-Unity测试工作室
http://x-unity.miik.com.ua/teststudio.aspx
将单元测试的强大功能带到VS .NET IDE
Ron Vecchi < RV ***** @ xilehdvecchi.com>在消息中写道
新闻:eE ************** @ TK2MSFTNGP09.phx.gbl ...
Hi,

Sleight of hand: specify an aspx file in the SRC attribute of the SCRIPT tag and generate the script on the fly in this aspx file.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ron Vecchi" <rv*****@xilehdvecchi.com> wrote in message
news:eE**************@TK2MSFTNGP09.phx.gbl...
我正在创建一个使用的自定义Web控件属性的枚举
{Remote,InLine}。
如果属性设置为内联,则从嵌入的
资源中读取文本,并将其作为内联java发送到aspx页面中的浏览器如果属性设置为Remote,则显示设置了SRC
属性的脚本标记< script language =" javascript"
Src =" MyJS.js"> ;< / script>。

有没有办法从浏览器捕获传入的请求(对于
< script language =" javascript" src =" myJavaScript.js" ;>< / script>
然后动态创建文件,然后返回对文件不存在的
浏览器的响应

谢谢,
Ron。
I am creating a custom web control that uses an enum for a property
{Remote,InLine}.
If the property is set to inline then text is read from the embedded
resource and sent to the browser in the aspx page as inline java script.
If the property is set to Remote then the script tag set with the SRC
attribute is displayed <script language="javascript"
Src="MyJS.js"></script>.

Is there a way to catch an incoming request from the browser (for the
<script language="javascript" src="myJavaScript.js"></script>
And then dynamically create the file before it returns a response to the
browser that the file does not exsit
Thanks,
Ron.



这篇关于动态创建要包含在响应中的.js文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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