1. Triggering client Events
Copy Code code as follows:
<ext:button id= "Button1" runat= "Server" text= "Hurry Me" >
<Listeners>
<click handler= "Greet ()" ></Click>
</Listeners>
</ext:Button>
<script type= "Text/javascript" >
function Greet () {
Alert ("Hello world!");
}
</script>
2. Triggering service-side events
Copy Code code as follows:
<ext:button id= "Button1" runat= "Server" text= "Hurry Me" >
<DirectEvents>
<click onevent= "Mybuttonclickhandler" ></Click>
</DirectEvents>
</ext:Button>
protected void Mybuttonclickhandler (object sender, Directeventargs e)
{
X.msg.alert ("Hello", "helloworld!");
}
Note: It stands to reason that the client will pop up a message box, debugging has been carried out to the background function, the front desk did not respond, the reasons unknown.
Directeventargs can also be replaced with System.EventArgs, but this will not be able to access certain properties, such as: Extraparams, the use of this parameter
3. Triggers the service-side event and passes the reference
Copy Code code as follows:
<DirectEvents>
<click onevent= "Mybuttonclickhandler" >
<ExtraParams>
<ext:parameter name= "param1" value= "value1" ></ext:Parameter>
</ExtraParams>
</Click>
</DirectEvents>
Background fetch parameters can be used in the following way: E. extraparams["param1"]
| |
| Actually sent the parameter to the server from the F12 tool of IE. 4. Custom Extra Properties
Copy code code as follows:
<ext:button id= "Button1" runat= "Server" text= "Hurry Me" >
<Listeners>
<click handler= "Cusproperty (this);" ></Click>
</Listeners>
<CustomConfig>
<ext:configitem name= "cus Property1 "value=" Thevalue mode= "Value" ></ext:ConfigItem>
</CustomConfig>
</ext:but ton>
<script type= "Text/javascript" function Cusproperty (obj) { Alert (obj.cuspropert y1); } </script>
|
The value of the successfully acquired property to the custom