如何调试Lightswitch中的删除按钮动作? [英] how to debug delete button action in Lightswitch?

查看:103
本文介绍了如何调试Lightswitch中的删除按钮动作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该在以VS2012编写的Lightswitch C#应用程序中发现一个错误 单击删除按钮时,导致应用程序挂起.我是LS的新手 并在找出如何查找内部代码时遇到问题 按钮被选中.即使当我尝试覆盖此按钮的操作时,调试器也不会在那里停下来.仅调试我的代码已关闭,在屏幕数据绑定上,我看到一些我在代码中找不到的名称.这里有人在光开关方面有一些经验,可以向我指出正确的方向吗?谢谢

I am supposed to find a bug in Lightswitch C# application written in VS2012 which causes application to hung when delete button is clicked. I am new to LS and have problem figuring out how to find the internal code is executed when that button is selected. Even when I try to override action of this button debugger doesn't stop there. Debugging just my code is turned off, on screen data binding I see some name I cannot find in the code. Anybody here has some experience with lightswitch to point me to right direction? thanks

推荐答案

Lightswitch HTML使用JavaScript作为背后的代码,而不是C#.典型的LS delete命令的示例:

Lightswitch HTML uses JavaScript for the code behind, not C#. An example of a typical LS delete command:

screen.Items.deleteSelected();

有时调试可能很麻烦,我经常发现我必须在运行应用程序之后放置断点 AFTER .或者,您可以使用粗略的调试方法,并在JavaScript中插入一堆alert()方法.这不是很漂亮,但是很有效.

Debugging can be a bitch at times, often i find i have to place breakpoints AFTER running the application. Alternatively, you could use a crude debugging method and insert a bunch of alert() methods in the JavaScript. It's not pretty, but it's effective.

注意:删除代码可能是调用WebAPI Web服务或针对数据库运行SQL.在这两种情况下,您都需要分别调试它们.

这篇关于如何调试Lightswitch中的删除按钮动作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆