The Studio for iPhone includes a built-in confirm dialog box that can be constructed using JavaScript. You can use this dialog box in conjunction with any of the controls, but in this topic you will use it with the OnClientClick event of the C1Button control so that the confirmation dialog box appears when the C1Button control is clicked
Complete the following steps:
1. Click the Design tab to enter Design view.
2. In the Toolbox, double-click the ScriptManager icon to add the control to your project.
3. In the Toolbox, double-click the C1Button icon to add the control to your project.
4. Right-click the C1Button control to bring up its context menu and then select Properties from the list.
The Properties window opens with C1Button's properties in focus.
5. Locate the OnClientClick property, click its drop-down arrow, and select Add new client side handler.
Source view opens. Observe that the C1Button1_OnClientClick JavaScript function has been added to the source and that the C1Button control's C1Button.OnClientClick property has been set to C1Button1_OnClientClick.
6. Place the following JavaScript code between the curly braces of the C1Button1_OnClientClick event:
$().c1iPhone().c1confirm(
function() {
alert('Changes accepted!');
},
'Are you sure?', '');
7. Open the project in a Studio for iPhone-compatible browser.
8. Click Button and observe that a dialog box appears, asking "Are you sure?".
9. Click OK. Another dialog box will appear, stating "Changes accepted!"