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||Onload||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 a debug mode from the Designer.
The form opens in a new browser tab as shown below.
Breakpoints tab in the debug window.
The form tree appears as shown below.
Set a breakpoint on the following actions:
Refresh the browser window to invoke the OnLoad 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 can navigate to the control
tab and update the value.
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.