asp.net mvc - Model binding for float fails -


i'm trying send window's position server. model binding top fails. action method below:

public void winclosed(window position) 

and window model:

public class window {     public decimal left { get; set; }     public double top { get; set; } } 

in picture can see sample values:

window's positioin

and javascript code:

var position = this.wrapper.offset(); $.post("@url.action("winclosed", "home")", position); 

the first line relative kendo window. i've tried double, , float types in model.

the decimal separator culture (fa-ir) / (forward slash) character. need replace . character / character. 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 }); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -