Home All Groups Group Topic Archive Search About

Asp:Imagebutton and javascript



Author
18 Mar 2005 10:31 PM
JIM
Hello,

I've an asp:Imagebutton on my form with the visible property set to false

<asp:Imagebutton ID="tstImage" runat=Server visible=False>

How can I set the visible propery to true using a javascript ?
I tried something like document.GetElementById('ImgTest').visible='true';
but without succes ....

Any idea ?

Many thanks,

KArel

Author
18 Mar 2005 10:56 PM
darrel
> How can I set the visible propery to true using a javascript ?
> I tried something like document.GetElementById('ImgTest').visible='true';
> but without succes ....

You can't. If you're setting the visibility on the control, then that's
being controlled by the codebehind. If it's set to be visible="false" it
won't even be rendered in the HTML.

For what you want, I think you want to place the button in a DIV and then
HIDE the div via javascript when the page loads. That way it's part of the
DOM and you can then do what you want with it via javascript.

-Darrel

AddThis Social Bookmark Button