FLhr
|
| Posted: 11/15/2002, 12:57 PM |
|
This is not exactly CCS but I know that there are a lot of ASP experts out
there.
I'm passing a variable via a URL to an ASP script
(http://domain.com?variable=somevalue)
I then do:
<% session("filename") = request("variable") &".htm" %>
What I want to do is an a server side include:
<!-- #include file = variable -->
but I cannot get the correct syntaxt to make it work.
Can somebody tell me what the syntax is?
TIA.
flhr
|
|
|
 |
Shawn Mason
|
| Posted: 11/15/2002, 8:42 PM |
|
Assuming you are using VBScript with your ASP, then you have run into the
problem where the variables scope doesn't exist. I would suggest creating
the include to be a function where you can then pass the request variable as
a parameter.
--
Kindest Regards,
Shawn Mason,CCD,MCP
I.S. Software Design Associates
"FLhr" <flhr2003@yahoo.com> wrote in message
news:ar3n4f$1h2$1@news.codecharge.com...
> This is not exactly CCS but I know that there are a lot of ASP experts out
> there.
>
> I'm passing a variable via a URL to an ASP script
> (http://domain.com?variable=somevalue)
>
> I then do:
> <% session("filename") = request("variable") &".htm" %>
>
> What I want to do is an a server side include:
> <!-- #include file = variable -->
>
> but I cannot get the correct syntaxt to make it work.
>
> Can somebody tell me what the syntax is?
>
> TIA.
> flhr
>
>
|
|
|
 |
FLhr
|
| Posted: 11/16/2002, 5:08 PM |
|
No, no VBScript. I'm not a VBScript programmer and just know a little ASP
(very little). I can do this in Cold Fusion, but wanted to do it in ASP
instead.
Thanks.
flhr
"Shawn Mason" <shawn@issda.com> wrote in message
news:ar4ib1$gd8$1@news.codecharge.com...
> Assuming you are using VBScript with your ASP, then you have run into the
> problem where the variables scope doesn't exist. I would suggest creating
> the include to be a function where you can then pass the request variable
as
> a parameter.
>
> --
> Kindest Regards,
>
> Shawn Mason,CCD,MCP
> I.S. Software Design Associates
|
|
|
 |
Shawn Mason
|
| Posted: 11/16/2002, 5:32 PM |
|
Then what scripting language are you using? (You have several choices for
ASP pages, VBScript being just one).
--
Kindest Regards,
Shawn Mason,CCD,MCP
I.S. Software Design Associates
"FLhr" <flhr2003@yahoo.com> wrote in message
news:ar6q6m$97k$1@news.codecharge.com...
> No, no VBScript. I'm not a VBScript programmer and just know a little ASP
> (very little). I can do this in Cold Fusion, but wanted to do it in ASP
> instead.
>
> Thanks.
> flhr
>
> "Shawn Mason" <shawn@issda.com> wrote in message
>news:ar4ib1$gd8$1@news.codecharge.com...
> > Assuming you are using VBScript with your ASP, then you have run into
the
> > problem where the variables scope doesn't exist. I would suggest
creating
> > the include to be a function where you can then pass the request
variable
> as
> > a parameter.
> >
> > --
> > Kindest Regards,
> >
> > Shawn Mason,CCD,MCP
> > I.S. Software Design Associates
>
>
|
|
|
 |
FLhr
|
| Posted: 11/17/2002, 8:27 AM |
|
Sorry Shawn. Yes, it's VBScript. What I meant is that I'm not a VBScript
person, hence my question. I can just do this in Cold Fusion but I figured
I'd keep this page in ASP.
Cold Fusion (assuming the file name is the parameter:
<cfif IsDefined("URL.parm")>
<cfinclude template="#URL.parm#">
</cfif>
That's fairly straight forward. So I tried this in ASP (again assuming parm=
the filename):
<!-- #include file="<%=request("parm")%>" --> then I tried
<!-- #include file=<%=request("parm")%> -->
I tried several flavors of this but no go. Not know VBscript, I don't know
where the problem is. I would not be surprised if it's something real dumb
that I'm missing here.
I have found a work around but I don't really like it. It's working by
using if / else if statements. But then I have to change the code if I add
a page.
Thanks again.
flhr
"Shawn Mason" <shawn@issda.com> wrote in message
news:ar6rjr$bek$1@news.codecharge.com...
> Then what scripting language are you using? (You have several choices for
> ASP pages, VBScript being just one).
>
> --
> Kindest Regards,
>
> Shawn Mason,CCD,MCP
> I.S. Software Design Associates
>
> "FLhr" <flhr2003@yahoo.com> wrote in message
>news:ar6q6m$97k$1@news.codecharge.com...
> > No, no VBScript. I'm not a VBScript programmer and just know a little
ASP
> > (very little). I can do this in Cold Fusion, but wanted to do it in ASP
> > instead.
> >
> > Thanks.
> > flhr
> >
> > "Shawn Mason" <shawn@issda.com> wrote in message
> >news:ar4ib1$gd8$1@news.codecharge.com...
> > > Assuming you are using VBScript with your ASP, then you have run into
> the
> > > problem where the variables scope doesn't exist. I would suggest
> creating
> > > the include to be a function where you can then pass the request
> variable
> > as
> > > a parameter.
> > >
> > > --
> > > Kindest Regards,
> > >
> > > Shawn Mason,CCD,MCP
> > > I.S. Software Design Associates
> >
> >
>
>
|
|
|
 |
Shawn Mason
|
| Posted: 11/17/2002, 11:45 AM |
|
Since ASP is not interpreted until run-time, the Include directive takes the
code in the include and generates it alongside the other code (this can be
html or ASP/VBScript code). Since I don't use CF I'm not sure but by
looking at your example it is a little different in this regard. What I
would do is Include the function like you have (w/o the parm though), then
in your ASP page, get the parameter and place it into a variable and then
pass taht to the function. I think this will do what you are wanting to do.
--
Kindest Regards,
Shawn Mason,CCD,MCP
I.S. Software Design Associates
"FLhr" <flhr2003@yahoo.com> wrote in message
news:ar8g1v$596$1@news.codecharge.com...
> Sorry Shawn. Yes, it's VBScript. What I meant is that I'm not a VBScript
> person, hence my question. I can just do this in Cold Fusion but I
figured
> I'd keep this page in ASP.
>
> Cold Fusion (assuming the file name is the parameter:
> <cfif IsDefined("URL.parm")>
> <cfinclude template="#URL.parm#">
> </cfif>
>
> That's fairly straight forward. So I tried this in ASP (again assuming
parm=
> the filename):
> <!-- #include file="<%=request("parm")%>" --> then I tried
> <!-- #include file=<%=request("parm")%> -->
>
> I tried several flavors of this but no go. Not know VBscript, I don't
know
> where the problem is. I would not be surprised if it's something real
dumb
> that I'm missing here.
>
> I have found a work around but I don't really like it. It's working by
> using if / else if statements. But then I have to change the code if I
add
> a page.
>
> Thanks again.
> flhr
>
>
> "Shawn Mason" <shawn@issda.com> wrote in message
>news:ar6rjr$bek$1@news.codecharge.com...
> > Then what scripting language are you using? (You have several choices
for
> > ASP pages, VBScript being just one).
> >
> > --
> > Kindest Regards,
> >
> > Shawn Mason,CCD,MCP
> > I.S. Software Design Associates
> >
> > "FLhr" <flhr2003@yahoo.com> wrote in message
> >news:ar6q6m$97k$1@news.codecharge.com...
> > > No, no VBScript. I'm not a VBScript programmer and just know a little
> ASP
> > > (very little). I can do this in Cold Fusion, but wanted to do it in
ASP
> > > instead.
> > >
> > > Thanks.
> > > flhr
> > >
> > > "Shawn Mason" <shawn@issda.com> wrote in message
> > >news:ar4ib1$gd8$1@news.codecharge.com...
> > > > Assuming you are using VBScript with your ASP, then you have run
into
> > the
> > > > problem where the variables scope doesn't exist. I would suggest
> > creating
> > > > the include to be a function where you can then pass the request
> > variable
> > > as
> > > > a parameter.
> > > >
> > > > --
> > > > Kindest Regards,
> > > >
> > > > Shawn Mason,CCD,MCP
> > > > I.S. Software Design Associates
> > >
> > >
> >
> >
>
>
|
|
|
 |
FLhr
|
| Posted: 11/17/2002, 12:09 PM |
|
I'll see if I can do that Shawn.
Thanks again.
flhr
"Shawn Mason" <shawn@issda.com> wrote in message
news:ar8rki$oat$1@news.codecharge.com...
> Since ASP is not interpreted until run-time, the Include directive takes
the
> code in the include and generates it alongside the other code (this can be
> html or ASP/VBScript code). Since I don't use CF I'm not sure but by
> looking at your example it is a little different in this regard. What I
> would do is Include the function like you have (w/o the parm though), then
> in your ASP page, get the parameter and place it into a variable and then
> pass taht to the function. I think this will do what you are wanting to
do.
>
> --
> Kindest Regards,
>
> Shawn Mason,CCD,MCP
> I.S. Software Design Associates
>
> "FLhr" <flhr2003@yahoo.com> wrote in message
>news:ar8g1v$596$1@news.codecharge.com...
> > Sorry Shawn. Yes, it's VBScript. What I meant is that I'm not a
VBScript
> > person, hence my question. I can just do this in Cold Fusion but I
> figured
> > I'd keep this page in ASP.
> >
> > Cold Fusion (assuming the file name is the parameter:
> > <cfif IsDefined("URL.parm")>
> > <cfinclude template="#URL.parm#">
> > </cfif>
> >
> > That's fairly straight forward. So I tried this in ASP (again assuming
> parm=
> > the filename):
> > <!-- #include file="<%=request("parm")%>" --> then I tried
> > <!-- #include file=<%=request("parm")%> -->
> >
> > I tried several flavors of this but no go. Not know VBscript, I don't
> know
> > where the problem is. I would not be surprised if it's something real
> dumb
> > that I'm missing here.
> >
> > I have found a work around but I don't really like it. It's working by
> > using if / else if statements. But then I have to change the code if I
> add
> > a page.
> >
> > Thanks again.
> > flhr
> >
> >
> > "Shawn Mason" <shawn@issda.com> wrote in message
> >news:ar6rjr$bek$1@news.codecharge.com...
> > > Then what scripting language are you using? (You have several choices
> for
> > > ASP pages, VBScript being just one).
> > >
> > > --
> > > Kindest Regards,
> > >
> > > Shawn Mason,CCD,MCP
> > > I.S. Software Design Associates
> > >
> > > "FLhr" <flhr2003@yahoo.com> wrote in message
> > >news:ar6q6m$97k$1@news.codecharge.com...
> > > > No, no VBScript. I'm not a VBScript programmer and just know a
little
> > ASP
> > > > (very little). I can do this in Cold Fusion, but wanted to do it in
> ASP
> > > > instead.
> > > >
> > > > Thanks.
> > > > flhr
> > > >
> > > > "Shawn Mason" <shawn@issda.com> wrote in message
> > > >news:ar4ib1$gd8$1@news.codecharge.com...
> > > > > Assuming you are using VBScript with your ASP, then you have run
> into
> > > the
> > > > > problem where the variables scope doesn't exist. I would suggest
> > > creating
> > > > > the include to be a function where you can then pass the request
> > > variable
> > > > as
> > > > > a parameter.
> > > > >
> > > > > --
> > > > > Kindest Regards,
> > > > >
> > > > > Shawn Mason,CCD,MCP
> > > > > I.S. Software Design Associates
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
 |
|