Include files

Results 1 to 3 of 3

Thread: Include files

  1. #1
    Join Date
    Sep 2008

    Default Include files

    Is there a way to put a varible in calling an include file. I have a page whre it will grab an include file of a news article. I want it to just grab the news article with the id that is given. So in querystring it would be .asp?id=101. I would want to have include be<BR><BR>#include virtual="articles101.asp"<BR><BR>so the 101 would change to what the id would be. I know I can do it with a case statement but that means each time I add an article I have to add to the case statement. <BR><BR>Thanks<BR><BR>Chris

  2. #2
    Join Date
    Dec 1969

    Default RE: Include files

    Technically, actually, you can&#039;t do it using a case statement. It may appear that you can, but you can&#039;t.<BR><BR>Try the FAQs - "ASPFAQS" link, top-right. "Nature of Things" category, from memory.<BR><BR>There&#039;s three or four articles on it.<BR><BR>Craig.

  3. #3
    Join Date
    Dec 1969

    Default And, by the way, not advanced...

    See rules of this forum. If it&#039;s in the ASPFAQs, then by definition it&#039;s not advanced.<BR><BR>Besides, in your post in the other forum you mentioned using a Textstream. And *that* can work.<BR><BR>There are also other solutions. Including Server.Execute, for example. Though it has its limitations. <BR><BR>And some people will try to seduce you into using the VBS "Execute" statement. I think that&#039;s a mistake, in general, but it probably works okay on not-so-busy sites.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts