提问人:Aura4 提问时间:11/14/2023 更新时间:11/14/2023 访问量:32
为什么 TypeScript 代码没有从 C# 代码中获取任何返回值?
Why does the TypeScript code not get any return value from the C# code?
问:
我使用 $.ajax 从 TypeScript 调用 C# 方法。虽然我返回了一个值,但我没有得到它。在控制台中,仅显示消息“result from RegionGrowing:”。
下面是 TypeScript 代码:
$.ajax({
type: "POST",
url: "/ShapeDetection/RegionGrowing",
data: {
points: points,
faces: faces,
mousex: pointer.x.toString(),
mousez: pointer.z.toString()
},
success: (result) => {
console.log("result from RegionGrowing: ", result);
},
dataType: "json"
});
我简化了 C# 代码:
[HttpPost]
public JsonResult RegionGrowing(SimpleShape simpleShape)
{
return Json("hello world");
}
因此,我本来希望控制台中出现“result from RegionGrowing: hello world”。
答: 暂无答案
下一个:检索分页后面的元素屏幕截图
评论