Intersoft WebDesktop Documentation
OnClientClick Property
See Also  Example Send Feedback
ISNet.WebUI.WebDesktop Namespace > WebButton Class : OnClientClick Property


Glossary Item Box

Specifies the javascript function to invoke when the button is clicked.

Syntax

Visual Basic (Declaration) 
Public Property OnClientClick As String
Visual Basic (Usage)Copy Code
Dim instance As WebButton
Dim value As String
 
instance.OnClientClick = value
 
value = instance.OnClientClick
C# 
public string OnClientClick {get; set;}

Remarks

When operates in client side mode, developers generally implement the OnClientClick client side event to execute the javascript codes to response the button click. Otherwise, when operates in server side mode, developers can write codes in OnClick server side event to response the button click.

Example

The following example shows you how to use WebButton's client side event OnClientClick to invoke JavaScript Alert and show a WebDialogBox. You need to type 'onclick' in the OnClientClick property.
JScriptCopy Code
<script language="javascript">
   function onClick()
   {
       if(!IS.moz)
           alert("WebButton OnClientClick Event");            
       var dlg = ISGetObject("WebDialogBox1");
       dlg.ShowDialog();
    }
</script>

Requirements

Target Platforms: 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

See Also

© 2012 Intersoft Solutions Corp. All Rights Reserved.