Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2004
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help with my select case...

    Code:
    	<% 
    	   Select Case Request.QueryString("Section")
    	%>
    	<% Case "history" %>
    	<!--#include file = "history.asp"-->
    	<% Case "forsale" %>
    	<!--#include file = "forsale.asp"-->
    	<% End Select %>
    I'm a total beginner at ASP. I coded in PHP before but started to move over to ASP a tad.
    Well, what I'm trying to do is use the URL to include certain pages(code) in a section of my web page. In PHP it's was as easy as
    Code:
    <?php include($_GET['Section'] . ".php"); ?>
    excuse if that syntax is incorrect I'm a bit rusty.

    Unfortunately it's not that simple in ASP. It takes a few more steps to accomplish what I want to do. The syntax above is what I'm trying to use to get it to work but that's not working. Could anyone help me out? Or help me out on another route I should go to accomplish this?

  • #2
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    the first thing I nwould check is your case sensitivity. Although keywords and variables arent case sensitive, strings are. This is a common mistake when moving from php to asp - thinking you dont have to worry about case anymore.
    The second thing I would check is that you're running on iis 5, conditional includes dont work on anytihng less.
    try
    Code:
    response.write request.querystring("Section")
    and see what it thinks the section is.

  • #3
    New Coder
    Join Date
    Nov 2004
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by NancyJ
    the first thing I nwould check is your case sensitivity. Although keywords and variables arent case sensitive, strings are. This is a common mistake when moving from php to asp - thinking you dont have to worry about case anymore.
    The second thing I would check is that you're running on iis 5, conditional includes dont work on anytihng less.
    try
    Code:
    response.write request.querystring("Section")
    and see what it thinks the section is.

    There was a typo in my url :-) Thanks for the help :-)


  •  

    Posting Permissions

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