...

View Full Version : help with my select case...



dottedquad
09-18-2005, 09:59 PM
<%
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
<?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?

NancyJ
09-18-2005, 10:20 PM
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
response.write request.querystring("Section") and see what it thinks the section is.

dottedquad
09-18-2005, 10:36 PM
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
response.write request.querystring("Section") and see what it thinks the section is.


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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum