有条件的包含在ASP中 [英] Conditional includes in ASP

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

问题描述

ASP eCommerce网站上有许多产品分类,并且希望基于该分类包含一个特定的文件.例如,如果URL为:

We have a number of categories with products in an ASP eCommerce site and, based on the category, would like a particular file to be included. For example, if URL is:

viewPrd.asp?idproduct=6&idcategory=18

然后根据idCategory=18我要包括:

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

如果是idCategory=19,那么我想包括:

If idCategory=19 then I would like to include:

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

,依此类推.任何帮助将不胜感激.

and so on. Any assistance would be appreciated.

推荐答案

我使用的脚本取自

I use a script taken from https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=9796&lngWId=4 (dynamic ASP inclusion)

因此,在代码中包含该脚本之后,您只需要编写:

So after including that script in your code, you just have to write:

myMenu = Request.Querystring("idCategory")
Include("menu"&myMenu&".asp")

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

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