Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
835
How do I set the text of an imageButton at runtime?
posted

At runtime, the text attribute of an imageButton is not available.  How can I set it?

Mark <><

Parents
No Data
Reply
  • 45049
    posted

    You need to use the client-side object model (CSOM) of WebImageButton to set its text, specifically its setText() function.

    var imgbtn = ig_getWebControlById("<% =WebImageButton1.ClientID %>");
    imgbtn.setText("My New Text");

Children