Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Wizard.CancelButtonClick Event

Occurs when the Cancel button is clicked.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public event EventHandler CancelButtonClick

The CancelButtonClick event is raised when the Cancel button on the Wizard control is clicked. Use the CancelButtonClick event to provide additional processing when the Cancel button is clicked.

For more information about handling events, see Consuming Events.

The following code example demonstrates how to specify an event handler for the CancelButtonClick event. When the Cancel button is clicked, the page is redirected to http://www.wingtiptoys.com/.

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  void OnCancelButtonClick(object sender, EventArgs e)
    // When the Cancel button is clicked, redirect to http://www.wingtiptoys.com/.


<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>ASP.NET Example</title>
    <form id="form1" runat="server">
      <asp:Wizard id="Wizard1" 
          <asp:WizardStep title="Step 1" 
          <asp:WizardStep title="Step 2" 
          <b>CancelButtonClick Example</b>

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
© 2015 Microsoft