Post method from ajax not working

I’d say it’s:

<dot:Button
    Text={value: Result}
    Click={staticCommand: Result = MyViewModel.GetDate()} />

(Static commands | DotVVM Documentation)

ok, that is good! it helps when you just got something simple back, but what if you get back a json and need to create a chart with it in javascript(what I need to do)?

Getting Started | Chart.js (chartjs.org)

it’s all within the script section…

can I call the static function (that worked!) without the dotvvm control and within the script section? that would be the solution, or maybe there are other ways of doing it…

here is another example in full how the ajax javascript / webmethod (in code behind) works with webforms (ignore his issue with the string cause problem):
javascript - Create Charts with Chart.js Using C# string causes problems - Stack Overflow

Yes, you can use the NamedCommand control for this (Call DotVVM from JS | DotVVM Documentation). It’s unfortunately more complex than inlining the command into a script tag, but it gets the job done.

DotVVM does not have a way create HTTP API endpoints like the WebMethod did, but you can always other libraries for that (like MVC)