Reputation: 2409
I'm trying to send window's position to the server. But model binding for top
always fails. My action method is as below:
public void winClosed(Window position)
And the window model:
public class Window
{
public decimal Left { get; set; }
public double Top { get; set; }
}
In this picture you can see sample values:
And finally the JavaScript code:
var position = this.wrapper.offset();
$.post("@Url.Action("winClosed", "Home")", position);
The first line is relative to Kendo Window. I've already tried double
, and float
types in the model.
Upvotes: 0
Views: 598
Reputation:
The decimal separator for your culture (fa-IR) is /
(forward slash) character. You will need to replace the .
character with a /
character. For example
var offset = this.wrapper.offset();
var l = offset.left.toString().replace('.', '/');
var t = offset.top.toString().replace('.', '/');
$.post("@Url.Action("winClosed", "Home")", {left: l, top: t });
Upvotes: 1