CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 template blocks in included pages

Print topic Send  topic

Author Message
jpgygax

Posts: 2
Posted: 09/30/2005, 11:51 AM

Hi,

I'm evaluating CodeCharge Studio and am very impressed so far. But I've hit what seems to be a brick wall to me when I tried to implement a header for my pages.

The header include page I'm trying to implement is supposed to either:
a) show the currently logged user if one has already logged in OR
b) display the username and password input fields so that you can login

The problem is that templates (I'm using ASP3.0 with Templates, btw) don't seem to work in included pages: my OnBeforeShow handler code cannot seem to access the template blocks,
Tpl.Blocks
and
Header.TemplateBlock.Block("LoginView")
both fail (i.e. they do not return valid objects).

Is there a way around this?

Thanks for your help,

-- J-P Gygax
View profile  Send private message
jpgygax

Posts: 2
Posted: 09/30/2005, 12:36 PM

Follow-up:

I switched to PHP4 (server is actually running PHP5) and it works.

This leads me to think it ought to be possible with ASP too. What did I do wrong?

-- JP
View profile  Send private message
DonB
Posted: 09/30/2005, 12:38 PM

Yes. First, steer clear of directly massaging the Template object. It's
not needed and can be cumbersome to mess with.

In the header, you should have two things: a Label control and a Login
form. Now, add Before Show events to both of them.

For the Label the event code is:

Label1.Visible = Not isEmpty(CCGetUserID())

For the Login form, the event code is:

Login.Visible = isEmpty(CCGetUserID())


Sometimes "Empty" gives me headaches, and I end up modifying expressions to
look like this:

Label1.Visible = (CCGetUserID() <> "")

But anyway, this is all that's needed, not messy template manipulation.

--
DonB

http://www.gotodon.com/ccbth


"jpgygax" <jpgygax@forum.codecharge> wrote in message
news:6433d89345796a@news.codecharge.com...
> Hi,
>
> I'm evaluating CodeCharge Studio and am very impressed so far. But I've
hit
> what seems to be a brick wall to me when I tried to implement a header for
my
> pages.
>
> The header include page I'm trying to implement is supposed to either:
> a) show the currently logged user if one has already logged in OR
> b) display the username and password input fields so that you can login
>
> The problem is that templates (I'm using ASP3.0 with Templates, btw) don't
seem
> to work in included pages: my OnBeforeShow handler code cannot seem to
access
> the template blocks,
> Tpl.Blocks
> and
> Header.TemplateBlock.Block("LoginView")
> both fail (i.e. they do not return valid objects).
>
> Is there a way around this?
>
> Thanks for your help,
>
> -- J-P Gygax
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Jean-Pierre Gygax
Posted: 10/03/2005, 3:19 AM

Thanks Don,

for your help. Clearly CCS-generated objects make less trouble, yet
there are cases (I'm a little further along) where I want to dynamically
hide or show parts of my page. I'll continue looking.

-- JP

Add new topic Subscribe to topic   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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