How to: Handle Screen Events in a Mobile Client for a LightSwitch App
You can write the following kinds of methods to run when a user takes a certain action:
Button methods run when a user chooses a button.
General methods run when a user loads data, saves data, or closes a screen.
Access control methods run when a user tries to perform a task that requires certain permissions.
For more information about these kinds of methods, see the tables after the following procedure.
To handle an event
In Solution Explorer, open the screen that you want to modify.
The Screen Designer opens.
On the Screen Designer toolbar, open the Write Code list, and then choose the appropriate method
The Code Editor opens.
In the new method, enter the code that you want to run when the event occurs.
The following tables list methods that can run when a user interacts with a screen. All of these methods run on the client tier.
Called when a user chooses the button that’s associated with the method. Applies only to buttons based on custom methods.
Called just after the screen appears.
Called after the HTML for a control is created.
Called to create the HTML for a custom control.
Called just before a screen is is closed and data is saved.
Access Control Methods
Called before a method runs. LightSwitch calls this method to check permissions for the current user.