Wizard.AllowNavigationToStep メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Wizard.AllowNavigationToStep メソッドの意味・解説 

Wizard.AllowNavigationToStep メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

ブール値を使用して、ActiveStep プロパティを、渡されるインデックス対応する WizardStepBase オブジェクト設定できるかどうか確認します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Protected Overridable Function
 AllowNavigationToStep ( _
    index As Integer _
) As Boolean
protected virtual bool AllowNavigationToStep
 (
    int index
)
protected:
virtual bool AllowNavigationToStep (
    int index
)
protected boolean AllowNavigationToStep (
    int index
)
protected function AllowNavigationToStep (
    index : int
) : boolean

パラメータ

index

確認する WizardStepBase オブジェクトインデックス

戻り値
渡されインデックスが、既にアクセスされている WizardStepBase参照しており、その AllowReturn プロパティfalse設定されている場合falseそれ以外場合true

解説解説

AllowNavigationToStep メソッドは、protected 修飾子を持つため、派生クラスからのみアクセスできます派生クラスでは、AllowNavigationToStep メソッド使用することにより、渡されるインデックス使用して ActiveStepIndex プロパティ設定できるかどうか判断できます渡されインデックスが、既にアクセスされている WizardStepBase オブジェクト参照しており、その AllowReturn プロパティfalse設定されている場合AllowNavigationToStep メソッドfalse返しますそれ以外場合true返します

使用例使用例

CustomWizard という名前の派生クラス作成して、OnSideBarButtonClickメソッドオーバーライドする方法次のコード例示しますCustomWizard コントロールサイドバー領域ボタンクリックすると、選択したステップアクセスできるかどうか確認するために、AllowNavigationToStep メソッド呼び出されます。発生した処理をユーザー通知するメッセージ本体Web ページ書き込まれます。

<%@ Page Language="VB" %>

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

<script runat="server">

  ' This custom wizard control defines the OnSideBarButtonClick method
  ' that uses the AllowNavigationToStep method to determine whether
 the
  ' value passed in can be used to set the ActiveStepIndex property.
    
  Class CustomWizard
    Inherits Wizard
  
    Protected Overloads Sub
 OnSideBarButtonClick(ByVal sender As Object,
 _
      ByVal e As WizardNavigationEventArgs)
 Handles Me.SideBarButtonClick

      If AllowNavigationToStep(e.NextStepIndex) Then
        
        Me.Page.Response.Write("AllowNavigationToStep()
 returned true, moving to Step" & _
           (e.NextStepIndex + 1).ToString() & ".")
        Me.ActiveStepIndex = e.NextStepIndex
        
      Else
        
        Me.Page.Response.Write("AllowNavigationToStep()
 returned false for Step" & _
           (e.NextStepIndex + 1).ToString() & ", moving to
 Step2.")
        Me.ActiveStepIndex = 1
        
      End If
    End Sub
  End Class
  
  ' Add the custom wizard control to the page.
  Sub Page_Load(ByVal sender As
 Object, ByVal e As EventArgs)

    Dim WizardControl As New
 CustomWizard()
    WizardControl.ID = "WizardControl"
      
    ' Create some steps for the custom wizard.
    For i As Integer = 0
 To 5
      Dim newStep As New
 WizardStep()
      newStep.ID = "Step" & (i + 1).ToString()
      ' Set AllowReturn to false for some of the steps.        
      If ((i Mod 2) = 0) Then
        newStep.AllowReturn = False
      End If
        
      ' Add each step to the custom wizard.
      WizardControl.WizardSteps.Add(newStep)
    Next
      
    ' Display the wizard on the page.
    PlaceHolder1.Controls.Add(WizardControl)
    
  End Sub
  
</script>

<html>
  <body>
    <form id="Form1" runat="server">
      <h3>AllowNavigationToStep Example</h3>
      <asp:PlaceHolder id="PlaceHolder1" 
        runat="server" />
    </form>
  </body>
</html>
<%@ 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">

  // This custom wizard control defines the OnSideBarButtonClick method
  // that uses the AllowNavigationToStep method to determine whether
 the
  // value passed in can be used to set the ActiveStepIndex property.
    
  class CustomWizard : Wizard
  {    
    override protected void OnSideBarButtonClick(WizardNavigationEventArgs
 e)
    {
      base.OnSideBarButtonClick(e);
      if (AllowNavigationToStep(e.NextStepIndex))
      {
        this.Page.Response.Write("AllowNavigationToStep()
 returned true, moving to Step" 
          + (e.NextStepIndex + 1).ToString() + ".");
        this.ActiveStepIndex = e.NextStepIndex;
      }
      else
      {
        this.Page.Response.Write("AllowNavigationToStep()
 returned false for Step" 
          + (e.NextStepIndex + 1).ToString() + ", moving to Step2.");
        this.ActiveStepIndex = 1;
      }
    }         
  }
  
  // Add the custom wizard control to the page.
  void Page_Load(object sender, EventArgs e) 
  {
      CustomWizard WizardControl = new CustomWizard();
      WizardControl.ID = "WizardControl";
      
      // Create some steps for the custom wizard.
      for (int i = 0; i <= 5; i++)
      {
        WizardStep newStep = new WizardStep();
        newStep.ID = "Step" + (i + 1).ToString();
        // Set AllowReturn to false for some of the steps.        
        if ((i % 2) == 0)
        {
          newStep.AllowReturn = false;
        }
        
        // Add each step to the custom wizard.
        WizardControl.WizardSteps.Add(newStep);
      }
            
      // Display the wizard on the page.
      PlaceHolder1.Controls.Add(WizardControl);
  }
  
</script>

<html>
  <body>
    <form id="Form1" runat="server">
      <h3>AllowNavigationToStep Example</h3>
      <asp:PlaceHolder id="PlaceHolder1" 
        runat="server" />
    </form>
  </body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からWizard.AllowNavigationToStep メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からWizard.AllowNavigationToStep メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からWizard.AllowNavigationToStep メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

Wizard.AllowNavigationToStep メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Wizard.AllowNavigationToStep メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS