Sep 17, 2010, 12:17 PM
[CLOSED] DateTime parameter on DirectEvent
Hi,
In an MVC application I'm using code similar to the following:
If you click theButtonDateTime button, you get the attached error.
Bye,
Stefano
In an MVC application I'm using code similar to the following:
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Ext.NET</title>
<script type="text/javascript">
var getTheDate = function () {
var d = new Date(2010, 09, 10);
return d;
};
var getTheInt = function () {
var i = parseInt(123);
return i;
};
</script>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Button ID="ButtonInt" runat="server" Text="Test Int" Icon="Accept">
<DirectEvents>
<Click
Url="/Test/TestInt/"
CleanRequest="true"
Method="POST"
Success="Ext.Msg.show({
title: 'Test OK',
msg: 'OK.',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});"
Failure="Ext.Msg.show({
title: 'Test KO',
msg: result.errorMessage,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});">
<ExtraParams>
<ext:Parameter Name="theInt" Value="getTheInt()" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
<ext:Button ID="ButtonDateTime" runat="server" Text="Test Date" Icon="DateGo">
<DirectEvents>
<Click
Url="/Test/TestDateTime/"
CleanRequest="true"
Method="POST"
Success="Ext.Msg.show({
title: 'Test OK',
msg: 'OK.',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});"
Failure="Ext.Msg.show({
title: 'Test KO',
msg: result.errorMessage,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});">
<ExtraParams>
<ext:Parameter Name="theDate" Value="getTheDate()" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
</form>
</body>
</html>
these are the controller actions: public ActionResult TestDateTime(DateTime theDate)
{
return new AjaxResult();
}
public ActionResult TestInt(int theInt)
{
return new AjaxResult();
}
If you click the ButtonInt button, it's all OK.If you click theButtonDateTime button, you get the attached error.
Bye,
Stefano
Last edited by Daniil; Sep 20, 2010 at 4:24 PM.
Reason: [CLOSED]