Skip to content

6. Application pages

franciscoserdio edited this page Sep 20, 2016 · 4 revisions

Voila !

Your pages can just do this:

  1. Show a MessageBox, in WinForms style ;)

    protected void btn_Action_1_Click(object sender, EventArgs e)
    {
        this.MessageBox.ShowMessage(
            messageBoxKey: "ACTION_1_key",
            message: "Message to user for Action 1",
            messageType: MessageBoxType.Information,
            buttons: MessageBoxButtons.OK);
    }
  2. Manage their response (there is a key to identify different actions)

    /// <summary>
    /// Called when [response message box].
    /// </summary>
    /// <param name="sender">The sender.</param>
    /// <param name="e">The <see cref="MessageBoxEventArgs"/> instance containing the event data.</param>
    protected override void OnResponseMessageBox(object sender, MessageBoxEventArgs e)
    {
        //TODO: This is suitable for a table driven method. This is only one example
        this.txt_response.Text = string.Format("MessageBoxKey: {0}. Response: {1}", e.MessageBoxKey, e.Response);
    }

Clone this wiki locally