Re: about UserControl Visible property

From: Edward (zishi_at_citiz.net)
Date: 06/19/04


Date: Sun, 20 Jun 2004 00:48:43 +0800

I did . below is my code:

    void Page_Load(Object Sender, EventArgs e) {
        if (Page.IsPostBack == false) {
          ctlList.Visible = false;
        }
    }

    void btnGenerateInvoice_Click( Object Sender, EventArgs e ) {
      ctlList.Visible = true;
    }

> On Sat, 19 Jun 2004 23:07:36 +0800, "Edward" <zishi@citiz.net> wrote:
>
> >hi, everyone,
> >
> > I've one user control "ctlList" , and one button "View" in the Page, in
> >the Page_Load event, I set the ctlList.Visible to false, then in the
View's
> >click event, I set it to true.
> >
> > But the result is when Load , it's really invisible, but Click didn't
make
> >it visible.
> >
> > where's my fault?
> >
> >Edward
> >
>
> perhaps you didn't put the ctlList.Visible = false inside a postback
> check (ie
> if not ispostback then
> ctlList.Visible = false
> end if
> )
>
> if so then regardless of what happens in the onclick it still sets it
> to false when the page loads.
>
> hth,
> Brian