The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
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<
<% 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<
What day is it anyway?
نوشته شده در
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
<
http://www.devguru.com/technologies/asp/9167.asp
<
نوشته شده در
I just played with some code and got it to work the following way:All you need to do is add the folders before the certianpage_(1 or 2).asp for it to work.
I hope this helps... <
Code:
<% 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 hope this helps... <
Cheers,
David Greening
David Greening
نوشته شده در
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<
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<
What day is it anyway?
نوشته شده در
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<
<!--#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<
What day is it anyway?
نوشته شده در
I'll try Response.Write and just add all of the text possibilites.
-prescottw<
-prescottw<
What day is it anyway?
نوشته شده در
Nope... Once again I thank you both,
-prescottw<
-prescottw<
What day is it anyway?
نوشته شده در
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" --><
آخرین ویرایش توسط
نوشته شده در
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<
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<
What day is it anyway?
آخرین ویرایش توسط
Email Member
Message Member
Post Moderation
بارگزاری فایل
If you're having problems uploading, try choosing a smaller image.
پیشنمایش مطلب
Send Topic
Loading...