Asp:Imagebutton and javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JIM

    Asp:Imagebutton and javascript

    Hello,

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

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

    How can I set the visible propery to true using a javascript ?
    I tried something like document.GetEle mentById('ImgTe st').visible='t rue';
    but without succes ....

    Any idea ?

    Many thanks,

    KArel


  • darrel

    #2
    Re: Asp:Imagebutton and javascript

    > How can I set the visible propery to true using a javascript ?[color=blue]
    > I tried something like document.GetEle mentById('ImgTe st').visible='t rue';
    > but without succes ....[/color]

    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


    Comment

    Working...