Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 possible? <% if page="certainpage_1.asp" then %>

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
prescottw Posted - 22 January 2006 : 11:44:03
Does anyone have an idea what to do here? I have no idea what the attribute would be. Or if it is even defined as an attribute?

<% if page="certainpage_1.asp" then %>
<!-- #include file="meta1.asp" -->
<% end if %>

<% if page="certainpage_2.asp" then %>
<!-- #include file="meta_2.asp" -->
<% end if %>

and so on 3, 4, 5, 6, 7, 8, 9,

I'm looking to give inc_header a <meta name="keywords" content="more description, defined search results"> for certain added pages to my site.

Thank You,

-prescottw<
8   L A T E S T    R E P L I E S    (Newest First)
prescottw Posted - 22 January 2006 : 22:02:49
I get an event that states this

The Path parameter must be specified for the MapPath method.

I'm sure that it is because I'm not understanding.


Select Case Request.ServerVariables("URL")
Case "does-anything-go-here/certainpage_1.asp"
strPage = metafiles/meta_1.asp
Case "does-anything-go-here/certainpage_2.asp"
strPage = metafiles/meta_2.asp
Case Else
'do nothing
End Select

Server.Execute(strPage)

I'm probably to deep into this but I appreciate the help.


THank You!

-prescottw<
dayve Posted - 22 January 2006 : 15:19:26
quote:
Originally posted by Classicmotorcycling

I just played with some code and got it to work the following way:
<% if Request.ServerVariables("URL") = "/certainpage_1.asp" then %>
<!--#INCLUDE FILE="meta_1.asp" -->
<% end if %>

<% if Request.ServerVariables("URL") = "/certainpage_2.asp" then %>
<!--#INCLUDE FILE="meta_2.asp" -->
<% end if %>
All you need to do is add the folders before the certianpage_(1 or 2).asp for it to work.

I hope this helps...



the problem with this method is that all INCLUDE files are still loaded up and then the conditional statement displays the segment you want. this incurs additional load times and conflicting variables at times. the method I would go about using the Server.Execute method is:

Select Case Request.ServerVariables("URL")
 Case "/certainpage_1.asp"
   strPage = meta_1.asp 
 Case "/certainpage_2.asp"
   strPage = meta_2.asp
 Case Else
   'do nothing
End Select

Server.Execute(strPage)


quote:
You can not use conditional statements for INCLUDE files


what I meant to say with this statement is that you can not do something like this

<!--#INCLUDE FILE=strPage & ".asp" --><
prescottw Posted - 22 January 2006 : 14:53:52
Nope... Once again I thank you both,

-prescottw<
prescottw Posted - 22 January 2006 : 14:38:09
I'll try Response.Write and just add all of the text possibilites.

-prescottw<
prescottw Posted - 22 January 2006 : 14:35:34
if Request.ServerVariables("URL") = "certainpage_1.asp" then
<!--#INCLUDE FILE="meta_1.asp" -->
end if

if Request.ServerVariables("URL") = "certainpage_2.asp" then
<!--#INCLUDE FILE="meta_2.asp" -->
end if

I tried this and didin't get an expected statement error. The meta_1.asp didn't call either.

Still trying

Thank You,

-prescottw<
prescottw Posted - 22 January 2006 : 14:22:13
Thanks to You both.

I couldn't get either to call a different meta from my inc_header though. (It didn't call the file at all)....even though the file was not in the correct folder it did request the file. But after the file was positioned... the meta_1.asp did not open for inc_header. It asked for a statement.

I added the %> before and after <%

%>

<% if Request.ServerVariables("URL") = "certainpage_1.asp" then %>
<!--#INCLUDE FILE="metafiles/meta_1.asp" -->
<% end if %>

<% if Request.ServerVariables("URL") = "certainpage_2.asp" then %>
<!--#INCLUDE FILE="metafiles/meta_2.asp" -->
<% end if %>


<%



As I was able to learn from the replies. I may not have asked the question correctly.

I'm trying to let inc_header know that if it was called by certainpage1.asp then can it open metatag_1.asp

certainpage2.asp then inc_header will call metatag2.asp.

I want to replace

%>
<!--#INCLUDE FILE="metatag.asp" -->
<%

With options depending on which page is open.


I thank you both for this.

-prescottw<
Classicmotorcycling Posted - 22 January 2006 : 13:09:20
I just played with some code and got it to work the following way:
<% if Request.ServerVariables("URL") = "/certainpage_1.asp" then %>
<!--#INCLUDE FILE="meta_1.asp" -->
<% end if %>

<% if Request.ServerVariables("URL") = "/certainpage_2.asp" then %>
<!--#INCLUDE FILE="meta_2.asp" -->
<% end if %>
All you need to do is add the folders before the certianpage_(1 or 2).asp for it to work.

I hope this helps...
<
dayve Posted - 22 January 2006 : 12:25:26
You can not use conditional statements for INCLUDE files, also known as dynamic includes. What you can do and is a method I like is use Server.Execute. I have used it on a lot of the web sites I have developed that require dynamic pages to be called.

http://www.devguru.com/technologies/asp/9167.asp
<

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.19 seconds. Powered By: Snitz Forums 2000 Version 3.4.07