how to debug delete button action in Lightswitch?

左心房为你撑大大i 提交于 2020-01-07 03:08:18

问题


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


回答1:


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

screen.Items.deleteSelected();

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.

Note: The delete code could be calling a WebAPI web service, or running SQL against a database. In both these scenarios you will need to separately debug these.



来源:https://stackoverflow.com/questions/33928426/how-to-debug-delete-button-action-in-lightswitch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!