简体   繁体   English

如何将JS脚本链接到IIS虚拟目录浏览页面?

[英]How can I link a JS script to IIS virtual directory browsing pages?

How can I want to run a script on the pages that IIS returns when you browse the contents of a virtual directory (visiting the folders). 当您浏览虚拟目录的内容(访问文件夹)时,如何在IIS返回的页面上运行脚本。

The closest I could find was this full-blown module for generating pretty directory listings , where I could add a script to the page, but that's a lot more than I want. 我能找到的最接近的是用于生成漂亮目录列表的功能完善的模块 ,可以在其中向页面添加脚本,但这比我想要的要多得多。

Is there any simpler way that I can override/modify the default template page that gets used for displaying the directory contents? 有什么更简单的方法可以覆盖/修改用于显示目录内容的默认模板页面?

Unfortunately I could not find any way to actually change that template. 不幸的是,我找不到实际更改该模板的任何方法。

The best I've been able to find is that you would have to develop your own IIS module or handler to override the default behavior: http://www.iis.net/learn/develop/runtime-extensibility/developing-iis-modules-and-handlers-with-the-net-framework . 我能找到的最好的方法是,您必须开发自己的IIS模块或处理程序以覆盖默认行为: http : //www.iis.net/learn/develop/runtime-extensibility/developing-iis-带有网络框架的模块和处理程序 The link you provided would probably be the quickest route since the code is mostly done for you already. 您提供的链接可能是最快的路线,因为大多数代码已经为您完成了。

Update: you could also just create your own default.asp page and place it in every folder you want to have your customized listing. 更新:您也可以只创建自己的default.asp页,并将其放置在要包含自定义列表的每个文件夹中。 Code sample can be found as the answer to this question here: http://www.webmasterworld.com/forum47/520.htm 可以在此处找到代码示例作为对此问题的答案: http : //www.webmasterworld.com/forum47/520.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM