CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Dynamic Include pages

Print topic Send  topic

Author Message
Eros Olmi
Posted: 09/03/2003, 3:17 AM

Is it possible to use include functionality of CCS21 in such a way include
page can be defined at runtime maybe passed as parameters inside url? I mean
something like:
http://www.mysite.com/default.asp?CenterInclude=defaultcenter.asp
I would like to have a default.asp page the same for all site but change its
central contents making dynamic includes.

CCS support reply to me with the following example. I tried it but most o
fthe times it gives "Still executing last request" ASP error:

-------->> From support:
You should retrieve output of that script with InetCtls ActiveX object in
your custom code and assign it to some Label control (with Content property
set to
HTML) E.g.

set objInetTransCtrl = Server.CreateObject("InetCtls.Inet.1")
objInetTransCtrl.RequestTimeOut = 100
dim url: url = "http://yourhost.com/script.asp"
dim webpage: webpage = objInetTransCtrl.OpenURL(Cstr(url))
FormName.FieldName.Value = webpage


Generally you should put your custom code in Page/Properties/Events/Before
Show
and this code will get the name of page to include via
CCGetParam("CenterInclude","") call, then it should obtain the page itself.
<<--------

Thanks a lot
Eros

DonB
Posted: 09/03/2003, 5:24 AM

That's not really the way includes were designed to work. They have no
events to assist you with this. You should try to create one inlude that
has logic in it (BeforeShow event or maybe Initialize event) that changes
the content of the include.

Yo did not say what "central contents" contains so it's hard to be more
specific. In my case, I did this merely by creating multiple controls
(Record, Grid, etc.) in my page and changing their .Visible property so only
the portions I needed to show will be shown. A control that is "not
visible" will not do any database accesses or incur other significant
overhead (as being "not visible" short-circuits just about all the code in
the control), so this is an efficient way to have "dynamic content".

Your Include controls do have a .Visible property, so you can have multiple
include controls and only make the desired one visible. Obviously, this
won't help much if there is an indeterminate number of things you want to
put in there



--
DonB

http://www.gotodon.com/ccbth


"Eros Olmi" <erosolmi@libero.it> wrote in message
news:bj4f3b$li0$1@news.codecharge.com...
> Is it possible to use include functionality of CCS21 in such a way include
> page can be defined at runtime maybe passed as parameters inside url? I
mean
> something like:
> http://www.mysite.com/default.asp?CenterInclude=defaultcenter.asp
> I would like to have a default.asp page the same for all site but change
its
> central contents making dynamic includes.
>
> CCS support reply to me with the following example. I tried it but most o
> fthe times it gives "Still executing last request" ASP error:
>
> -------->> From support:
> You should retrieve output of that script with InetCtls ActiveX object in
> your custom code and assign it to some Label control (with Content
property
> set to
> HTML) E.g.
>
> set objInetTransCtrl = Server.CreateObject("InetCtls.Inet.1")
> objInetTransCtrl.RequestTimeOut = 100
> dim url: url = "http://yourhost.com/script.asp"
> dim webpage: webpage = objInetTransCtrl.OpenURL(Cstr(url))
> FormName.FieldName.Value = webpage
>
>
> Generally you should put your custom code in Page/Properties/Events/Before
> Show
> and this code will get the name of page to include via
> CCGetParam("CenterInclude","") call, then it should obtain the page
itself.
> <<--------
>
> Thanks a lot
> Eros
>
>

Eros Olmi
Posted: 09/03/2003, 5:56 AM

Don,
thanks for your reply.
I know that this is not the way include control has been designed. Infact
I've post a request on that at CCS support some time ago on this asking the
possibility to have include page dependant from parameters | sessions vars |
espression....

Regarding you suggestion, I will try it. I didn't know Invisible controls
does not access DB. I thought they did. can be one clever solution. Thanks.

To give you more details on what I would like to achieve:
I want to load a main default.asp page able to change it's center contents
but at the same time top, left and bottom area remains the same.
Standard way could be to make many main pages each including top,left,
bottom areas and managing the center area.
I want the main page remain the same and been able to change it's center
area depending on a url param or a session variable or an expression been
evaluated during runtime. So my idea was to have:
- default.asp (main page)
- header.asp (include)
- left.asp (include)
- footer.asp (include)
- .... many different pages included as center areas in the default.asp
Center areas can be from 2/3 to 8/10 with different contents.

Another way could be frames or iframe but I do not like them and also CCS
would not be evaluated I suppose.

I will let you know.
Regards
Eros


Eros Olmi
Posted: 09/04/2003, 5:56 AM

Hi again Don,
I tried you suggestion and seems to work fine.
The only problem is that I have the impression hidden control are evaluated
in any case. Not jet tested deeply but just an impression.
I've put inside code to show/hide control inside "After Initialize Event" of
the page. Manual says "This event occurs after all page components have been
initialized but before dynamic database content is processed" so if it's
true that hidden controls do not make access to DB, it should be ok.
Waiting CodeCharge to reply on my request to add event into Include control
....
Thanks a lot.
Eros


"DonB" <~ccbth~@gotodon.com> wrote in message
news:bj4mio$uuj$1@news.codecharge.com...
> That's not really the way includes were designed to work. They have no
> events to assist you with this. You should try to create one inlude that
> has logic in it (BeforeShow event or maybe Initialize event) that changes
> the content of the include.
>
> Yo did not say what "central contents" contains so it's hard to be more
> specific. In my case, I did this merely by creating multiple controls
> (Record, Grid, etc.) in my page and changing their .Visible property so
only
> the portions I needed to show will be shown. A control that is "not
> visible" will not do any database accesses or incur other significant
> overhead (as being "not visible" short-circuits just about all the code in
> the control), so this is an efficient way to have "dynamic content".
>
> Your Include controls do have a .Visible property, so you can have
multiple
> include controls and only make the desired one visible. Obviously, this
> won't help much if there is an indeterminate number of things you want to
> put in there
>
>
>
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "Eros Olmi" <erosolmi@libero.it> wrote in message
>news:bj4f3b$li0$1@news.codecharge.com...
> > Is it possible to use include functionality of CCS21 in such a way
include
> > page can be defined at runtime maybe passed as parameters inside url? I
> mean
> > something like:
> > http://www.mysite.com/default.asp?CenterInclude=defaultcenter.asp
> > I would like to have a default.asp page the same for all site but change
> its
> > central contents making dynamic includes.
> >
> > CCS support reply to me with the following example. I tried it but most
o
> > fthe times it gives "Still executing last request" ASP error:
> >
> > -------->> From support:
> > You should retrieve output of that script with InetCtls ActiveX object
in
> > your custom code and assign it to some Label control (with Content
> property
> > set to
> > HTML) E.g.
> >
> > set objInetTransCtrl = Server.CreateObject("InetCtls.Inet.1")
> > objInetTransCtrl.RequestTimeOut = 100
> > dim url: url = "http://yourhost.com/script.asp"
> > dim webpage: webpage = objInetTransCtrl.OpenURL(Cstr(url))
> > FormName.FieldName.Value = webpage
> >
> >
> > Generally you should put your custom code in
Page/Properties/Events/Before
> > Show
> > and this code will get the name of page to include via
> > CCGetParam("CenterInclude","") call, then it should obtain the page
> itself.
> > <<--------
> >
> > Thanks a lot
> > Eros
> >
> >
>
>

DonB
Posted: 09/04/2003, 6:22 AM

Take a look at any of the the code (Asp) pages in your project (not the
event pages, the standard ones). You will see that there is an "If"
statement at the start of data-access function (methods). These exit the
routine if Visible is "false" (as well as some other conditions). However,
it is true that the database connection is opened, which is a low-overhead
operation.

Not the ultimate optimization, but decent. It would be nice to have a
"Visible" on the include to completely shut it off when you don't need it.

--
DonB

http://www.gotodon.com/ccbth


"Eros Olmi" <erosolmi@libero.it> wrote in message
news:bj7cq2$f56$2@news.codecharge.com...
> Hi again Don,
> I tried you suggestion and seems to work fine.
> The only problem is that I have the impression hidden control are
evaluated
> in any case. Not jet tested deeply but just an impression.
> I've put inside code to show/hide control inside "After Initialize Event"
of
> the page. Manual says "This event occurs after all page components have
been
> initialized but before dynamic database content is processed" so if it's
> true that hidden controls do not make access to DB, it should be ok.
> Waiting CodeCharge to reply on my request to add event into Include
control
> ...
> Thanks a lot.
> Eros
>
>
> "DonB" <~ccbth~@gotodon.com> wrote in message
>news:bj4mio$uuj$1@news.codecharge.com...
> > That's not really the way includes were designed to work. They have no
> > events to assist you with this. You should try to create one inlude
that
> > has logic in it (BeforeShow event or maybe Initialize event) that
changes
> > the content of the include.
> >
> > Yo did not say what "central contents" contains so it's hard to be more
> > specific. In my case, I did this merely by creating multiple controls
> > (Record, Grid, etc.) in my page and changing their .Visible property so
> only
> > the portions I needed to show will be shown. A control that is "not
> > visible" will not do any database accesses or incur other significant
> > overhead (as being "not visible" short-circuits just about all the code
in
> > the control), so this is an efficient way to have "dynamic content".
> >
> > Your Include controls do have a .Visible property, so you can have
> multiple
> > include controls and only make the desired one visible. Obviously, this
> > won't help much if there is an indeterminate number of things you want
to
> > put in there
> >
> >
> >
> > --
> > DonB
> >
> > http://www.gotodon.com/ccbth
> >
> >
> > "Eros Olmi" <erosolmi@libero.it> wrote in message
> >news:bj4f3b$li0$1@news.codecharge.com...
> > > Is it possible to use include functionality of CCS21 in such a way
> include
> > > page can be defined at runtime maybe passed as parameters inside url?
I
> > mean
> > > something like:
> > > http://www.mysite.com/default.asp?CenterInclude=defaultcenter.asp
> > > I would like to have a default.asp page the same for all site but
change
> > its
> > > central contents making dynamic includes.
> > >
> > > CCS support reply to me with the following example. I tried it but
most
> o
> > > fthe times it gives "Still executing last request" ASP error:
> > >
> > > -------->> From support:
> > > You should retrieve output of that script with InetCtls ActiveX object
> in
> > > your custom code and assign it to some Label control (with Content
> > property
> > > set to
> > > HTML) E.g.
> > >
> > > set objInetTransCtrl = Server.CreateObject("InetCtls.Inet.1")
> > > objInetTransCtrl.RequestTimeOut = 100
> > > dim url: url = "http://yourhost.com/script.asp"
> > > dim webpage: webpage = objInetTransCtrl.OpenURL(Cstr(url))
> > > FormName.FieldName.Value = webpage
> > >
> > >
> > > Generally you should put your custom code in
> Page/Properties/Events/Before
> > > Show
> > > and this code will get the name of page to include via
> > > CCGetParam("CenterInclude","") call, then it should obtain the page
> > itself.
> > > <<--------
> > >
> > > Thanks a lot
> > > Eros
> > >
> > >
> >
> >
>
>

Eros Olmi
Posted: 09/04/2003, 6:41 AM

Don,
thanks, thanks, thanks!!
I just discovered Include control has Visible property ans it works!!
So my default.asp page has these includes:
- header
- footer
- center
Center Include page has many subincluded pages switched visible on/off by a
url parameters.
Here it it the function. So simple now that I know.

DefaultCenter is the page included in Default.asp in the center position.
cCenterDefault is the default include in case no params or wrong param is
specified
cCenterNews is another includable page visible in case "C" param is equal to
"news"
.... and so on... in this way you can have just one default.asp page changing
its contents during runtime.

Function DefaultCenter_OnInitializeView()
'DefaultCenter_OnInitializeView @1-164C6672

'Custom Code @44-73254650
' -------------------------
' Write your own code here.
' -------------------------
DefaultCenter.cCenterDefault.visible = false
DefaultCenter.cCenterNews.visible = false

dim c_param

c_param = CCGetParam("C", "")
select case ucase(c_param)
case "NEWS"
DefaultCenter.cCenterNews.visible = true
case else
DefaultCenter.cCenterDefault.visible = true
end select

'End Custom Code

End Function 'Close DefaultCenter_OnInitializeView @1-54C34B28


Many thanks a gain.

"DonB" <~ccbth~@gotodon.com> wrote in message
news:bj7eb8$h5q$1@news.codecharge.com...
> Take a look at any of the the code (Asp) pages in your project (not the
> event pages, the standard ones). You will see that there is an "If"
> statement at the start of data-access function (methods). These exit the
> routine if Visible is "false" (as well as some other conditions).
However,
> it is true that the database connection is opened, which is a low-overhead
> operation.
>
> Not the ultimate optimization, but decent. It would be nice to have a
> "Visible" on the include to completely shut it off when you don't need it.
>
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "Eros Olmi" <erosolmi@libero.it> wrote in message
>news:bj7cq2$f56$2@news.codecharge.com...
> > Hi again Don,
> > I tried you suggestion and seems to work fine.
> > The only problem is that I have the impression hidden control are
> evaluated
> > in any case. Not jet tested deeply but just an impression.
> > I've put inside code to show/hide control inside "After Initialize
Event"
> of
> > the page. Manual says "This event occurs after all page components have
> been
> > initialized but before dynamic database content is processed" so if it's
> > true that hidden controls do not make access to DB, it should be ok.
> > Waiting CodeCharge to reply on my request to add event into Include
> control
> > ...
> > Thanks a lot.
> > Eros
> >
> >
> > "DonB" <~ccbth~@gotodon.com> wrote in message
> >news:bj4mio$uuj$1@news.codecharge.com...
> > > That's not really the way includes were designed to work. They have
no
> > > events to assist you with this. You should try to create one inlude
> that
> > > has logic in it (BeforeShow event or maybe Initialize event) that
> changes
> > > the content of the include.
> > >
> > > Yo did not say what "central contents" contains so it's hard to be
more
> > > specific. In my case, I did this merely by creating multiple controls
> > > (Record, Grid, etc.) in my page and changing their .Visible property
so
> > only
> > > the portions I needed to show will be shown. A control that is "not
> > > visible" will not do any database accesses or incur other significant
> > > overhead (as being "not visible" short-circuits just about all the
code
> in
> > > the control), so this is an efficient way to have "dynamic content".
> > >
> > > Your Include controls do have a .Visible property, so you can have
> > multiple
> > > include controls and only make the desired one visible. Obviously,
this
> > > won't help much if there is an indeterminate number of things you want
> to
> > > put in there
> > >
> > >
> > >
> > > --
> > > DonB
> > >
> > > http://www.gotodon.com/ccbth
> > >
> > >
> > > "Eros Olmi" <erosolmi@libero.it> wrote in message
> > >news:bj4f3b$li0$1@news.codecharge.com...
> > > > Is it possible to use include functionality of CCS21 in such a way
> > include
> > > > page can be defined at runtime maybe passed as parameters inside
url?
> I
> > > mean
> > > > something like:
> > > > http://www.mysite.com/default.asp?CenterInclude=defaultcenter.asp
> > > > I would like to have a default.asp page the same for all site but
> change
> > > its
> > > > central contents making dynamic includes.
> > > >
> > > > CCS support reply to me with the following example. I tried it but
> most
> > o
> > > > fthe times it gives "Still executing last request" ASP error:
> > > >
> > > > -------->> From support:
> > > > You should retrieve output of that script with InetCtls ActiveX
object
> > in
> > > > your custom code and assign it to some Label control (with Content
> > > property
> > > > set to
> > > > HTML) E.g.
> > > >
> > > > set objInetTransCtrl = Server.CreateObject("InetCtls.Inet.1")
> > > > objInetTransCtrl.RequestTimeOut = 100
> > > > dim url: url = "http://yourhost.com/script.asp"
> > > > dim webpage: webpage = objInetTransCtrl.OpenURL(Cstr(url))
> > > > FormName.FieldName.Value = webpage
> > > >
> > > >
> > > > Generally you should put your custom code in
> > Page/Properties/Events/Before
> > > > Show
> > > > and this code will get the name of page to include via
> > > > CCGetParam("CenterInclude","") call, then it should obtain the page
> > > itself.
> > > > <<--------
> > > >
> > > > Thanks a lot
> > > > Eros
> > > >
> > > >
> > >
> > >
> >
> >
>
>


   


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

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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