Need help in variablizing my text

I am trying to make my MainCatPage Sub act as a container for the guts.

I took all the guts out of the MainCatPage Sub and tried to shove them into variable so that I could reference the variables from inside MainCatPage sub since I'm planning on using that Sub as the basis for many other pages where I wi ll just shove in different values for variables such as PageTitle and so on shown in the second link below.

I just need help formatting the syntax for both so that it works again after trying to shove stuff into variables.

Link 1 - container page

http://f2.pg.briefcase.yahoo.com/bc/dba332211/vwp2?.tok=bchedNVB.nh8RWkX&.dir=/EE&.dnm=Document2.txt&.src=bc

Link 2 - Where i moved out the core code and tried to shove them into variables for use wtih the Link 1, MainCatPage Sub routine

http://f2.pg.briefcase.yahoo.com/bc/dba332211/vwp2?.tok=bcpgdNVBr39NZLS1&.dir=/EE&.dnm=Document3.txt&.src=bc



LVL 1
dba123Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

thefritterfatboyCommented:
I don't understand what you are trying to do exactly... but I know you will have trouble with this line:

SearchInclude = "<!--#include virtual=""/sss1/search/sss_search.asp"" -->"

Are you trying to use dynamic includes?
0
dba123Author Commented:
correct. that line is giving me trouble.

All I'm trying to do is replace certain portions of MainCatPag with variables that contain the code instead of hard coding the code in that sub.  Because that code will change depending on what page I show.  So I moved certain code into an include page and into variables that used to be in MainCatPag so that I can now reference certain code in MainCatPag through variables instead of hard coding it into MainCatPag
0
dba123Author Commented:
I didn't want to have to copy and create another MainCatPag for another page.  I want to just reuse the structure of MainCatPag but pass different recordsets, URLs, etc. into that sub depending on what pages I call.  So that is why I am variablizing some of the code that was hard coded into MainCatPag at the beginning....prior to me posting this.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

thefritterfatboyCommented:
Your first problem is that you cannot assign an include file to a variable.

They way to variablise text is as follows:

const txtTitle = "the title to my page"

...

<html><head><title><%=txtTitle%></title></head>

...

It is better to use constants as they are a little easier on your memory usage. Please note that you cannot change a constant. If you wanted to add a full stop to the constant, you couldn't do it. If your text may need altering, use a variable.

EG:

dim myVar
if myValue = 1 then
myVar = "there is only 1"
else
myVar = "there are " & myValue
end if
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dba123Author Commented:
But my style is using Response.Write.  I need to know how to variablize it so that it will work inside my Response.Write statements.
0
dba123Author Commented:
I do not use constants, only variables
0
dba123Author Commented:
there has to be some way to do this in MainCatPage

 %><!--#include virtual=" & virtuallink & " --><%

where virtuallink = "/sss/search/sss_search.asp"
0
dba123Author Commented:
so is this the correct syntax in the MainCatPage to refer to the variables shown below:

      If Request.QueryString("action") <> "search" Then
            Response.Write (" & RecordSetCode_InitEntry & ")
      else
            Response.Write (" & RecordSetCode_SearchResults & ")
      End If
0
dba123Author Commented:
nevermind on the last question figured it out myself.  These are the things I'm trying to ensure are correct for example.

Just needed to do Response.Write RecordSetCode_InitEntry
0
dba123Author Commented:
Ok, so this doesn't work.  I"m trying to shove the stored proc and call to the stored proc into a variable

      If Request.QueryString("action") <> "search" Then
            strSQL = "sp_Get_Allsss_sss"
            Query.Open strSQL, objConnection, adOpenStatic, adLockReadOnly, adCmdText
      else
            Query.CursorLocation = 3
            Query.Open strSQL, objConnection, adOpenStatic, adLockReadOnly, adCmdText
      End If

to

      If Request.QueryString("action") <> "search" Then
            Response.Write RecordSetCode_InitEntry
      else
            Response.Write RecordSetCode_SearchResults
      End If

This is one example out of my page.  I need help with all my variables like this cause the syntax isn't right, it is erroring out on me

0
dba123Author Commented:
If you look at the second link, those variables  RecordSetCode_InitEntry and  RecordSetCode_SearchResults are defined fut the asp page doesn't like how I shoved the query and call into those variables for some reason.  It treats it as text instead of inline vb code in my MainCatPage sub
0
thefritterfatboyCommented:
It may be that your code is outside of a set of <% %> delimiter tags.

This is inline text
<%
'this is VBScript
%>
More inline text

You may find that a <% tag is missing.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.