Select Case (Includes) HELP!!

Results 1 to 5 of 5

Thread: Select Case (Includes) HELP!!

  1. #1
    Strider Guest

    Default Select Case (Includes) HELP!!

    Can someone explain how to use this:<BR>&#060;% page = request.querystring("page") %&#062;<BR>&#060;%SELECT CASE page<BR>CASE index %&#062;<BR>&#060;!--#include virtual="/includes/menu.asp"--&#062;<BR>&#060;%CASE index1 %&#062;<BR>&#060;!--#include virtual="/includes/works2.asp"--&#062;<BR>&#060;%CASE index2 %&#062;<BR>&#060;!--#include virtual="/includes/works3.asp"--&#062;<BR>&#060;%END SELECT%&#062;<BR><BR>Thanks in Advance! <BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    168

    Default RE: Select Case (Includes) HELP!!

    Simple answer is you can&#039t.<BR><BR>If you were to run that piece of code you would end up with menu.asp, works2.asp, and works3.asp being included in your code.<BR><BR>Depending on the content of those files you may be able to get around this by using the FileSystem Object and opening the files for reading and echoing them back to the user with a response.write.<BR><BR>Hope this helps... Cheers!

  3. #3
    Join Date
    Dec 1969
    Posts
    41

    Default RE: Select Case (Includes) HELP!!

    The reason this will not conditionaly include your includes is that all includes are included before any asp is executed.

  4. #4
    Join Date
    Dec 1969
    Posts
    41

    Default RE: Select Case (Includes) HELP!!

    The reason this will not conditionaly include your includes is that all includes are included before any asp is executed.<BR><BR>This may not be a problem depending on what the includes do. All the code that is in the includes will be included, but will be processed conditionally.


  5. #5
    John Weeflaar Guest

    Default RE: Select Case (Includes) HELP!!

    Hello friends: Strider, Desiree, Faisal.<BR>I think, yes you can use SELECT CASE to include the .asp<BR>file that you wish to include based on a certain condition.<BR>index, index1, and index2 are simply 3 variables that must<BR>be initialized or assigned before the code:<BR>&#060;% page = request.querystring("page") %&#062;<BR>or can be from previous form.<BR>So, for example:<BR>index = "menu"<BR>index1 = "works2"<BR>index2 = "works3"<BR><BR>Now, type in the text box in previous form one word:<BR>"menu" (or "works2", or "works3").<BR>Based on this particular word, the response page will include<BR>one .asp file. If you type "menu", it&#039ll include "menu.asp" only, etc.<BR><BR>Good Luck<BR><BR>John<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
  •