We have added new a new X.Defer() Method and .Defer functionality to the JFunction class.
If you update from Svn, or the upcoming 2.5.1 release, all the following functionality will be enabled.
Example
<%@ Page Language="C#" %>
<script runat="server">
protected void Button1_Click(object el, DirectEventArgs e)
{
// Option 1 - New X.Defer() Method
// Pass in a Hander, or client-side Function name, and the delay value in Milliseconds
var handler = "window.location = 'default.aspx';";
X.Defer(handler, 3000);
// Option 2 = New X.Defer() Method with client-side function name
// Pass in a client-side function name, and the specify the delay in Milliseconds
var fn = "doSomething";
X.Defer(fn, 3000);
// Option 3 - New X.Defer() Method JFunction
// Pass a JFunction to .Defer, and specify the delay in Milliseconds
var func = new JFunction
{
Handler = @"window.location = 'default.aspx';"
};
X.Defer(func, 3000);
// Option 4 - Call .Defer on a JFunction
new JFunction
{
Handler = "window.location = 'default.aspx';"
}.Defer(3000);
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET Example</title>
<script type="text/javascript">
var doSomething = function () {
window.location = 'default.aspx';
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Button runat="server" Text="Submit" OnDirectClick="Button1_Click" />
</form>
</body>
</html>
Hope this helps.