CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> .NET

 hiding controls in my header.

Print topic Send  topic

Author Message
drpcken

Posts: 60
Posted: 10/25/2004, 3:02 PM

I have a header thats listed in all my pages. I have a label in that header that I hide before show and only show under certian circumstances.

My question is, can I control the visiblity of the label from the page that the header is included in?
View profile  Send private message
Tuong Do
Posted: 10/25/2004, 6:00 PM

Hi drpcken,

Yes you can control the visibility with the page
For example your incluede page is called myheader
And there is a label called label1 with that includable page

Then in the page that the header is included

In the On Initilised View event of the page


FindControl("myheader").FindControl("label1").visible = false




"drpcken" <drpcken@forum.codecharge> wrote in message
news:8417d77eac8c04@news.codecharge.com...
>I have a header thats listed in all my pages. I have a label in that
>header
> that I hide before show and only show under certian circumstances.
>
> My question is, can I control the visiblity of the label from the page
> that the
> header is included in?
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

drpcken

Posts: 60
Posted: 10/26/2004, 6:59 AM

Hey thanks for the answer. What you said makes perfect sense, but when I try and build, it tells me 'text' is not a member of 'System.Web.UI.Control'

The visible property seems to work, but I wanted to change the text as well, I think I have a way around, but I was wondering why the text property wouldn't work if the visible property would not.

Thanks!!
View profile  Send private message
Tuong Do
Posted: 10/26/2004, 9:12 PM

Hi drpcken,
To pass the compiler you have to declare the variable before you can assign
the text attribute

Dim alabel = FindControl("myheader").FindControl("label1")
alabel.text = "This is a test"

However, since the value of label1 is re populated in the myheader which is
happen after the above code, so the value of label1 is unchange

To get around the problem, what I normally do is

In the myheader page set the value of the label1 to a session variable
<code>
label1.text = Session("label1")
Session("label1") = nothing
</code>
In the initialize view event of the page that the header is included in,
set session("label1") to something
<code>
Session("label1") = "this is a label"
</code>




"drpcken" <drpcken@forum.codecharge> wrote in message
news:8417d77eac8c04@news.codecharge.com...
>I have a header thats listed in all my pages. I have a label in that
>header
> that I hide before show and only show under certian circumstances.
>
> My question is, can I control the visiblity of the label from the page
> that the
> header is included in?
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


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.

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.