CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Dynamicaly Including pages

Print topic Send  topic

Author Message
Vladimiro Paredes
Posted: 12/18/2002, 2:10 PM

Hello
Could anyone help me with this please.
I want to dynamicaly include pages depending on the option user picks in a
combo box.

Ex:
combo box values: {a, b, c}
if user selects a then I would include a.asp
if user selects a then I would include b.asp
if user selects a then I would include c.asp


Kasper Pedersen
Posted: 12/19/2002, 7:03 AM

Think the easiest solution would be inserting all the pages and then
controlling them using the .Visible attribute ... if its only 3 forms.

Alternative:
Make three folders named a,b,c (LETTER) and let the dynamic pages be named
in the same fashion - eg. "dynInc.asp". In the bottom of the generated code
you'll find:

<!-- #INCLUDE FILE="dynInc.asp" -->

change this to

<!-- #INCLUDE FILE=.\" & CCGetParam("LETTER","") & "\dynInc.asp" -->

---------------------------------
The last solutionn is definately UGLY, but you wont have to change anything
else and thats nice

:-) Kasper


"Vladimiro Paredes" <vparedes@exodusgroup.net> wrote in message
news:atqrpe$tnh$1@news.codecharge.com...
> Hello
> Could anyone help me with this please.
> I want to dynamicaly include pages depending on the option user picks in a
> combo box.
>
> Ex:
> combo box values: {a, b, c}
> if user selects a then I would include a.asp
> if user selects a then I would include b.asp
> if user selects a then I would include c.asp
>
>
>

Sixto Luis Santos
Posted: 12/19/2002, 2:44 PM

I'm afraid that <!-- #INCLUDE FILE=.\" & CCGetParam("LETTER","") &
"\dynInc.asp" --> won't work.

Server-side includes are processed before the code.



"Kasper Pedersen" <kasper@bentbyg.dk> wrote in message
news:atsn4g$m06$1@news.codecharge.com...
> Think the easiest solution would be inserting all the pages and then
> controlling them using the .Visible attribute ... if its only 3 forms.
>
> Alternative:
> Make three folders named a,b,c (LETTER) and let the dynamic pages be named
> in the same fashion - eg. "dynInc.asp". In the bottom of the generated
code
> you'll find:
>
> <!-- #INCLUDE FILE="dynInc.asp" -->
>
> change this to
>
> <!-- #INCLUDE FILE=.\" & CCGetParam("LETTER","") & "\dynInc.asp" -->
>
> ---------------------------------
> The last solutionn is definately UGLY, but you wont have to change
anything
> else and thats nice
>
> :-) Kasper
>
>
> "Vladimiro Paredes" <vparedes@exodusgroup.net> wrote in message
>news:atqrpe$tnh$1@news.codecharge.com...
> > Hello
> > Could anyone help me with this please.
> > I want to dynamicaly include pages depending on the option user picks in
a
> > combo box.
> >
> > Ex:
> > combo box values: {a, b, c}
> > if user selects a then I would include a.asp
> > if user selects a then I would include b.asp
> > if user selects a then I would include c.asp
> >
> >
> >
>
>

Sean Roe
Posted: 12/23/2002, 8:34 AM

One solution that I am currently using calls for wrapping asp statements
around the includes. My problem is determining if this solution will cause
any problems with my application. So far it works as expected just make sure
that you declare variables in the calling asp page or make the variables
unique in each of the includes. I also include a case else statement for the
default choice in case the user gets cute and edits the query string.

Hope this helps,
Sean

Here is my example:
<%
dim sSelection
sSelection = Request.QueryString("Choice")

Select Case sSelection
Case "a" %>
<!-- #include file = "a.asp" -->
<% Case "b" %>
<!-- #include file = "b.asp" -->
<% Case "c" %>
<!-- #include file = "c.asp" -->
<% Case Else %>
<!-- #include file = "a.asp" -->
<% End Select %>

"Vladimiro Paredes" <vparedes@exodusgroup.net> wrote in message
news:atqrpe$tnh$1@news.codecharge.com...
> Hello
> Could anyone help me with this please.
> I want to dynamicaly include pages depending on the option user picks in a
> combo box.
>
> Ex:
> combo box values: {a, b, c}
> if user selects a then I would include a.asp
> if user selects a then I would include b.asp
> if user selects a then I would include c.asp
>
>
>

Vic
Posted: 12/25/2002, 6:43 AM

Also with previous (if include pages-CCS) try to replace page class like :

Function Page_AfterInitialize() 'Page_AfterInitialize @1-1E3DE16C
'Custom Code @12-73254650
Set Incl=Nothing
if Request.QueryString("Choice")="a" then
Set Incl = New clsInclA
else
Set Incl = New clsInclB
end if
Incl.BindEvents
Incl.Initialize
'End Custom Code

End Function 'Close Page_AfterInitialize @1-54C34B28

Vic


"Sean Roe" <smroe@bak.rr.com> wrote in message
news:au7dtt$rn0$1@news.codecharge.com...
> One solution that I am currently using calls for wrapping asp statements
> around the includes. My problem is determining if this solution will cause
> any problems with my application. So far it works as expected just make
sure
> that you declare variables in the calling asp page or make the variables
> unique in each of the includes. I also include a case else statement for
the
> default choice in case the user gets cute and edits the query string.
>
> Hope this helps,
> Sean
>
> Here is my example:
> <%
> dim sSelection
> sSelection = Request.QueryString("Choice")
>
> Select Case sSelection
> Case "a" %>
> <!-- #include file = "a.asp" -->
> <% Case "b" %>
> <!-- #include file = "b.asp" -->
> <% Case "c" %>
> <!-- #include file = "c.asp" -->
> <% Case Else %>
> <!-- #include file = "a.asp" -->
> <% End Select %>
>
> "Vladimiro Paredes" <vparedes@exodusgroup.net> wrote in message
>news:atqrpe$tnh$1@news.codecharge.com...
> > Hello
> > Could anyone help me with this please.
> > I want to dynamicaly include pages depending on the option user picks in
a
> > combo box.
> >
> > Ex:
> > combo box values: {a, b, c}
> > if user selects a then I would include a.asp
> > if user selects a then I would include b.asp
> > if user selects a then I would include c.asp
> >
> >
> >
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.