javascript - Adding OnClientClick to a button generated at runtime -


i have created button @ runtime , add onclientclick property of button,to execute javascript function, example alert(), in case. piece of code works in firefox , other browsers not chrome. appreciate here.

    button addbutton = new button { text = "test", cssclass = "btn", usesubmitbehavior = false};     addbutton.onclientclick = "javascript:alert('button has being clicked');"; 


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -