Click here to Skip to main content
15,899,475 members

Comments by Nizar Belhiba (Top 12 by date)

Nizar Belhiba 19-Apr-20 15:37pm View    
Yes. And every thing is fine. Just the view dont show. And i get the message this function cant be load Http Error 415
Nizar Belhiba 19-Apr-20 15:16pm View    
Yep, you are right. BUT to be honest, as always had a breakpoint I did never noticed that the website didn't show up. I always just check if my List in my Controller get propper filled as I wished without continuing above that point.
And meanwhile, I had some other issue to deal with so when I came back and removed the breakpoint I've just noticed the issue
Nizar Belhiba 17-Apr-20 8:07am View    
Sorry @F-ES Sitecore I updatet the code
I tried within my click Funktion with $('#btnClick').click(function (e) {

canvasFields = [{
id: 1,
recStartx: 2,
recStarty: 3,
recWidth: 4,
recHeight: 5
},
{
id: 2,
recStartx: 2,
recStarty: 3,
recWidth: 4,
recHeight: 5
}];


$.ajax({
url: "@Url.Action("GetCanvasFields")",
type: 'post',
contentType: 'application/json',
data: JSON.stringify(canvasFields),
success: function () {
alert("yes");
},
error: function (errMsg) {
alert(errMsg);
}
})
});

and here it did work but as soon I keep canvasFields.push(canvasField); I get result null
Nizar Belhiba 17-Apr-20 8:03am View    
Deleted
Sorry I update my code, it was due that I changes several time the names to test. but that is the final version.
The thing is
If I delete canvasFields.push(canvasField); I get in my methode List count = 0..
but if I keep it I get null
so somehow the pb is with filling the canvasFields array
Nizar Belhiba 16-Apr-20 15:08pm View    
unfortunately that was not the issue, I know how to serials and deserials a json string/file in c#. Even if I change my method to get a string it's still empty.