I have dialog box with a Imagebutton (which is used as a save) and l want to stop users pressing it more than once.
Hiw can l disable the button and still call the server side event?
Hi Naish,
If button is disabled, then you may use __doPostBack. Below is example:
<script type="text/javascript">function WebImageButton1_Click(oButton, oEvent){ // if that is external event (not from WebImageButton.ClientSideEvents), // then to get reference to WebImageButton1 you may use: //var oButton = ig$('<%=WebImageButton1.ClientID%>'); oButton.setEnabled(false);}function triggerClick(){ var oButton = ig$('<%=WebImageButton1.ClientID%>'); if(oButton.getEnabled()) oButton.click(); else __doPostBack(oButton.getUniqueID(), '0');}</script><igtxt:WebImageButton ID="WebImageButton1" runat="server" Text="Once"> <ClientSideEvents Click="WebImageButton1_Click" /></igtxt:WebImageButton><input type="button" value="Trigger Click Event" onclick="triggerClick()" />