Dela via


How to: Provide Options for Users

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Users of a voice-only application should be able to exit the current dialog, ask for help, and issue other commands that are not part of the current question and answer dialog. Use Command controls to enable users to issue these commands.

Command controls share scope with other Dialog Speech Controls or Application Speech Controls, which means that a Command control's grammars are active for every Dialog Speech Control or Application Speech Control in that scope.

Grammars that define command words or phrases are typically separate from grammars that define the words or phrases associated with regular question and answer dialogs. Command grammars define words and phrases such as Help, Exit, and Main Menu.

Associate command grammars with a Command control and associate the Command control with a Dialog Speech Control or Application Speech Control.

Associating Command Grammars with a Command Control

To associate a speech or DTMF Command grammar with a Command control

  1. In the Toolbox, drag a Command control onto the design canvas of an .aspx page.

  2. Right-click the Command control, and then click Property Builder to open the General panel of the Command Property Builder.

  3. In the tree view, click General under the Input heading.

Note

Associate a new grammar file, a new inline grammar, or an existing grammar file with the Command control, just as with a QA control.

Associating a Command Control with Speech Controls

To associate a Command control with a Dialog Speech Control or Application Speech Control

  1. In the Toolbox, drag a Command control onto the design canvas of an .aspx page.

  2. Right-click the Command control, and then click Property Builder to open the General panel of the Command Property Builder.

  3. In the Scope box, type or select the ID of the control with which this Command control shares scope.

    Note

    To specify that the Command control shares scope with multiple controls, place the relevant controls within a Panel Web Form control on a page, and then type or select the ID of the Panel control in the Scope box.

When a Command control shares scope with another control that is active, the grammar associated with the Command control is also active. Users can issue commands during the question and answer cycle defined by the other control and activate the grammar associated with the Command control.

When a Command control shares scope with an Application Speech Control and the user says the command "Help," the help prompt played back to the user depends on whether the Command control contains a prompt:

  • If the Command control contains a prompt, that prompt is played when a user says "Help," instead of the default prompt that is contained in the Application Speech Control.
  • If the Command control does not contain a prompt, the default prompt of the Application Speech Control is played when the user says "Help."

Creating a Custom Help Command

To create a custom Help command

  1. Right-click a Command control, and then click Property Builder to open the General panel of the Command Property Builder.

  2. In the Scope box, type or select the ID of the Application Speech Control with which this Command control shares scope.

  3. In the Type box, type Help.

  4. In the tree view pane, click General under the Voice Output heading.

  5. Type an inline prompt or specify a prompt function, just as with a QAcontrol.

    For more information about the General panel of the Command Property Builder, click Help.

Testing Against a Command Grammar

To test words, phrases, or keypresses against a speech or DTMF Command grammar

  1. Right-click a Command control on an .aspx page, and then click Property Builder to open the General panel of the Command Property Builder.

  2. In the tree view pane, click General under the Input heading, and then do one of the following:

    • To test against a speech grammar, click the Grammar tab, and then click XPathTrigger Sample Sentence Tool to expand the XPathTrigger Sample Sentence tool for the speech grammar.
    • To test against a DTMF grammar, click the DTMF tab, and then click XPathTrigger Sample Sentence Tool to expand the XPathTrigger Sample Sentence tool for the DTMF grammar.

Specifying General Input Command Control Properties

To specify general input Command control properties

  1. Right-click a Command control on an .aspx page, and then click Property Builder to open the General panel of the Command Property Builder.

  2. In the tree view pane, click General under the Input heading, and then do any or all of the following:

    • In the XPathTrigger box, type or select the XPath expression that semantically identifies the Command control in the SML document.
    • In the OnClientCommand box, type the name of a client-side function called when the Triggered event is raised.
    • If the Command control should post back to the server after each user interaction, select AutoPostBack.
  3. If AutoPostBack is selected, type or select the name of the event handler for the Triggered event in the Triggered box.

Associating Inline Prompts with a Command Control

To associate inline prompts with a Command control

  1. Right-click a Command control on an .aspx page, and then click Property Builder to open the General panel of the Command Property Builder.

  2. In the tree view pane, click General under the Output heading.

See Also

Other Resources

Design Dialog Flow
Create SALT Voice Response Application Projects