Debug a form - example
This example illustrates debugging a form.
Create a sample form to display upcoming conferences and enable users to select a conference from the list, provide their name, and book a place at the conference.
The "Book conference" form contains the following controls and actions.
Form/control type | Form/control name | Event type | Action type | Action name | To do the following |
---|---|---|---|---|---|
Form | BookConference | Loaded | DBquery | GetConferences | Populate the table |
Table with two columns: Date and Location | tblConferenceList | RowSelected RowDeselected | SamePage | SelectConference | Populate the calendar and textbox with the date and location |
Calendar | Date | DateChanged | Display the selected date | ||
Textbox | Location | TextChanged | Display the selected location | ||
Textbox | Your Name | TextChanged | Provide name | ||
Button | Book Now | Clicked | .Net action | SaveConference | Book seat at the conference |
-
Open the form in debug mode from the Designer.
The form opens in a new browser tab.
- Click the Breakpoints tab in the debug window.
-
Set a breakpoint on the following actions:
-
GetConferences
-
SelectConference
-
SaveConference
-
-
Refresh the browser window to invoke the Loaded event.
The Actions tab gets populated with the GetConferences action. Expand this action to view the inputs into the DB Query. The controls, form, and global variables tabs all contain the current value.
-
Select to run to the next breakpoint.
The GetConferences action on the action tab gets updated with the output from the DB Query. As this is an array, you cannot see any values, however, as this populates the table control, you can view the contents of the table within the control tab.
-
Click a row on the table.
The Actions tab gets cleared and gets populated with the SelectConference action. As this is a client-side action, you cannot expand it to view any details. The controls, form, and global variables tabs all contain the current value.
-
Select to run to the next breakpoint. If you entered the wrong value for the location, you could navigate to the
control tab and update the value.
-
Click the
Book now button.
The Actions tab gets cleared and gets populated with the SaveConference action. As this is a server-side action, you can expand it to view the input/output. The controls, form and global variables tabs all contain the current value.