' Example to trigger postback manually. Me.WebImageButton1.AutoSubmit = False Me.WebImageButton1.ClientSideEvents.Click = "clickButton1" ' Below are codes in aspx (or any other script file loaded to client) <script language="javascript"> // function called before WebImageButton1 gets the click event function clickButton1(oButton, oEvent) { // Trigger postback only if button was clicked by mouse if(oEvent.action == "0") oEvent.needPostBack = true; // Next line would trigger post back on any click event (Space, Enter, AccessKey) //oEvent.needPostBack = true; } </script>
// Example to trigger postback manually. this.WebImageButton1.AutoSubmit = false; this.WebImageButton1.ClientSideEvents.Click = "clickButton1"; // Below are codes in aspx (or any other script file loaded to client) <script language="javascript"> // function called before WebImageButton1 gets the click event function clickButton1(oButton, oEvent) { // Trigger postback only if button was clicked by mouse if(oEvent.action == "0") oEvent.needPostBack = true; // Next line would trigger post back on any click event (Space, Enter, AccessKey) //oEvent.needPostBack = true; } </script>
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2