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:
Unfortunately, include files are a feature of IIS, not ASP. They are included before the page is sent to the ASP-processor that interprets your ASP code. For this reason you can't have conditional includes. The includes are already in place when the ASP code is executed.
To have conditional code in ASP you could use script components (WSC files), which you can include/load conditionally, or use big if...then or case.. constructions inside an include.
More info on the use of WSC's can be found here
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")
As far i know its not possible on a "elegant way", but i suggest you to take a look in those links:
is it possible to issue dynamic include in asp-classic?
https://support.microsoft.com/en-us/kb/192144
Regards.