MultiView.SwitchViewByIndexCommandName フィールドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > MultiView.SwitchViewByIndexCommandName フィールドの意味・解説 

MultiView.SwitchViewByIndexCommandName フィールド

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

指定されView インデックス基づいて、MultiView コントロール内のアクティブView コントロール変更関連付けられているコマンド名を表します。このフィールド読み取り専用です。

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

Public Shared ReadOnly SwitchViewByIndexCommandName
 As String
Dim value As String

value = MultiView.SwitchViewByIndexCommandName
public static readonly string
 SwitchViewByIndexCommandName
public:
static initonly String^ SwitchViewByIndexCommandName
public static final String SwitchViewByIndexCommandName
public static final var
 SwitchViewByIndexCommandName : String
解説解説

SwitchViewByIndexCommandName フィールド使用して、"SwitchViewByIndex" コマンド名を表します

このフィールドの値を使用してMultiView コントロール備わっているアクティブView コントロール自動更新機能利用できます。たとえば、クリックされたときに最初View移動する Button コントロールView コントロール格納されている場合は、CommandName プロパティSwitchViewByIndexCommandName フィールドの値、つまり "SwitchViewByIndex" を設定できます。CommandArgument プロパティを、MultiView コントロール内の最初Viewインデックス、つまり 0 に設定します。これにより、ボタンクリックされると、MultiView コントロールは ActiveViewIndex プロパティ自動的に 0 に設定します

使用例使用例

MultiView コントロール使用して基本調査作成する方法コード例次に示します。各 View コントロールは、個別調査質問です。PreviousViewCommandName フィールドと NextViewCommandName フィールドは、それぞれに調査の前および次の View コントロール自動的に移動するために使用しますユーザー調査最後View の [Retake Survey] ボタンクリックすると、SwitchViewByIndexCommandName フィールドコマンド引数 0 と共に使用されユーザー調査最初Viewリダイレクトして戻されます。

メモメモ

次のコード サンプルはシングルファイル コード モデル使用しており、分離コード ファイル直接コピーされ場合正常に動作しない可能性あります。このコード サンプルは、拡張子.aspx の空のテキスト ファイルコピーする必要がありますWeb フォームコード モデル詳細については、「ASP.NET Web ページコード モデル」を参照してください

<%@ Page Language="VB" %>

  <script runat="server">

    Sub Page4SaveButton_Click(ByVal sender
 As Object, ByVal e As
 System.EventArgs)
        
      ' The user wants to save the survey results.
      ' Insert code here to save survey results.
        
      ' Disable the navigation buttons.
      Page4Save.Enabled = False
      Page4Restart.Enabled = False

    End Sub

</script>

<html>
<head id="Head1" runat="server">
  <title>MultiView.SwitchViewByIndexCommandName Example</title>
</head>
<body>
    <form ID="Form1" runat="Server">
        
      <h3>MultiView.SwitchViewByIndexCommandName Example</h3>
        
      <asp:Panel id="Page1ViewPanel" 
        Width="330px" 
        Height="150px"
        HorizontalAlign =Left
        Font-size="12" 
        BackColor="#C0C0FF" 
        BorderColor="#404040"
        BorderStyle="Double"                     
        runat="Server">  

        <asp:MultiView id="DevPollMultiView"
          ActiveViewIndex=0
          runat="Server">

          <asp:View id="Page1" 
            runat="Server">   

            <asp:Label id="Page1Label" 
              Font-bold="true"                   
      
              Text="What kind of applications do you develop?"
              runat="Server">
            </asp:Label>
            
            <br/><br/>

            <asp:RadioButton id="Page1Radio1"
              Text="Web Applications" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="server">
            </asp:RadioButton>
            
            <br/>

            <asp:RadioButton id="Page1Radio2"
              Text="Windows Forms Applications" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="server">
            </asp:RadioButton>
                     
            <br/><br/><br/>                                   
    
                     
            <asp:Button id="Page1Next"
              Text = "Next"
              CommandName="NextView"
              Height="25"
              Width="70"
              runat= "Server">
            </asp:Button>     
                          
          </asp:View>

          <asp:View id="Page2" 
            runat="Server">

            <asp:Label id="Page2Label" 
              Font-bold="true"                   
     
              Text="How long have you been a developer?"
              runat="Server">                    
            </asp:Label>
            
            <br/><br/>

            <asp:RadioButton id="Page2Radio1"
              Text="Less than five years" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/>

            <asp:RadioButton id="Page2Radio2"
              Text="More than five years" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/><br/><br/>

            <asp:Button id="Page2Back"
              Text = "Previous"
              CommandName="PrevView"
              Height="25"
              Width="70"
              runat= "Server">
            </asp:Button> 

            <asp:Button id="Page2Next"
              Text = "Next"
              CommandName="NextView"
              Height="25"
              Width="70"
              runat="Server">
            </asp:Button> 
                
          </asp:View>

          <asp:View id="Page3" 
            runat="Server">

            <asp:Label id="Page3Label1" 
              Font-bold="true"                   
     
              Text= "What is your primary programming language?"
                        
              runat="Server">                    
            </asp:Label>
            
            <br/><br/>

            <asp:RadioButton id="Page3Radio1"
              Text="Visual Basic" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/>

            <asp:RadioButton id="Page3Radio2"
              Text="C#" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/>

            <asp:RadioButton id="Page3Radio3"
              Text="C++" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/><br/>

            <asp:Button id="Page3Back"
              Text = "Previous"
              CommandName="PrevView"
              Height="25"
              Width="70"
              runat="Server">
            </asp:Button> 

            <asp:Button id="Page3Next"
              Text = "Next"
              CommandName="NextView"
              Height="25"
              Width="70"
              runat="Server">
            </asp:Button>
            
            <br/>
                    
          </asp:View>     
            
          <asp:View id="Page4"
            runat="Server">
                    
          <asp:Label id="Label1"
            Font-bold="true"                     
                      
            Text = "Thank you for taking the survey."
            runat="Server">
          </asp:Label>
                    
          <br/><br/><br/><br/><br/><br/>    
   
                           
          <asp:Button id="Page4Save"
            Text = "Save Responses"
            OnClick="Page4SaveButton_Click"
            Height="25"
            Width="110"
            runat="Server">
          </asp:Button>
                
          <asp:Button id="Page4Restart"
            Text = "Retake Survey"
            commandname="SwitchViewByIndex"
            commandargument="0"
            Height="25"
            Width="110"
            runat= "Server">
          </asp:Button>                    
                    
        </asp:View>  
       
      </asp:MultiView>
        
    </asp:Panel> 

  </form>
</body>
</html>
<%@ Page Language="C#" %>

  <script runat="server">

    void Page4SaveButton_Click(Object sender, System.EventArgs
 e)
    {
      // The user wants to save the survey results.
      // Insert code here to save survey results.
        
      // Disable the navigation buttons.
      Page4Save.Enabled = false;
      Page4Restart.Enabled = false;

    }
    
  </script>
  
<html>
<head id="Head1" runat="server">
  <title>MultiView.SwitchViewByIndexCommandName Example</title>
</head>
<body>
    <form ID="Form1" runat="Server">
        
      <h3>MultiView.SwitchViewByIndexCommandName Example</h3>
        
      <asp:Panel id="Page1ViewPanel" 
        Width="330px" 
        Height="150px"
        HorizontalAlign =Left
        Font-size="12" 
        BackColor="#C0C0FF" 
        BorderColor="#404040"
        BorderStyle="Double"                     
        runat="Server">  

        <asp:MultiView id="DevPollMultiView"
          ActiveViewIndex=0
          runat="Server">

          <asp:View id="Page1" 
            runat="Server">   

            <asp:Label id="Page1Label" 
              Font-bold="true"                     
    
              Text="What kind of applications do you develop?"
              runat="Server">
            </asp:Label>
            
            <br/><br/>

            <asp:RadioButton id="Page1Radio1"
              Text="Web Applications" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="server">
            </asp:RadioButton>
            
            <br/>

            <asp:RadioButton id="Page1Radio2"
              Text="Windows Forms Applications" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="server">
            </asp:RadioButton>
                     
            <br/><br/><br/>                                   
    
                     
            <asp:Button id="Page1Next"
              Text = "Next"
              CommandName="NextView"
              Height="25"
              Width="70"
              runat= "Server">
            </asp:Button>     
                          
          </asp:View>

          <asp:View id="Page2" 
            runat="Server">

            <asp:Label id="Page2Label" 
              Font-bold="true"                     
   
              Text="How long have you been a developer?"
              runat="Server">                    
            </asp:Label>
            
            <br/><br/>

            <asp:RadioButton id="Page2Radio1"
              Text="Less than five years" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/>

            <asp:RadioButton id="Page2Radio2"
              Text="More than five years" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/><br/><br/>

            <asp:Button id="Page2Back"
              Text = "Previous"
              CommandName="PrevView"
              Height="25"
              Width="70"
              runat= "Server">
            </asp:Button> 

            <asp:Button id="Page2Next"
              Text = "Next"
              CommandName="NextView"
              Height="25"
              Width="70"
              runat="Server">
            </asp:Button> 
                
          </asp:View>

          <asp:View id="Page3" 
            runat="Server">

            <asp:Label id="Page3Label1" 
              Font-bold="true"                     
   
              Text= "What is your primary programming language?"      
                  
              runat="Server">                    
            </asp:Label>
            
            <br/><br/>

            <asp:RadioButton id="Page3Radio1"
              Text="Visual Basic" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/>

            <asp:RadioButton id="Page3Radio2"
              Text="C#" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/>

            <asp:RadioButton id="Page3Radio3"
              Text="C++" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/><br/>

            <asp:Button id="Page3Back"
              Text = "Previous"
              CommandName="PrevView"
              Height="25"
              Width="70"
              runat="Server">
            </asp:Button> 

            <asp:Button id="Page3Next"
              Text = "Next"
              CommandName="NextView"
              Height="25"
              Width="70"
              runat="Server">
            </asp:Button>
            
            <br/>
                    
          </asp:View>     
            
          <asp:View id="Page4"
            runat="Server">
                    
          <asp:Label id="Label1"
            Font-bold="true"                       
                    
            Text = "Thank you for taking the survey."
            runat="Server">
          </asp:Label>
                    
          <br/><br/><br/><br/><br/><br/>    
   
                           
          <asp:Button id="Page4Save"
            Text = "Save Responses"
            OnClick="Page4SaveButton_Click"
            Height="25"
            Width="110"
            runat="Server">
          </asp:Button>
                
          <asp:Button id="Page4Restart"
            Text = "Retake Survey"
            commandname="SwitchViewByIndex"
            commandargument="0"
            Height="25"
            Width="110"
            runat= "Server">
          </asp:Button>                    
                    
        </asp:View>  
       
      </asp:MultiView>
        
    </asp:Panel> 

  </form>
</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
MultiView クラス
MultiView メンバ
System.Web.UI.WebControls 名前空間
View
SwitchViewByIDCommandName
PreviousViewCommandName
NextViewCommandName
その他の技術情報
MultiView Web サーバー コントロールおよび View Web サーバー コントロール



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

辞書ショートカット

すべての辞書の索引

MultiView.SwitchViewByIndexCommandName フィールドのお隣キーワード
検索ランキング

   

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



MultiView.SwitchViewByIndexCommandName フィールドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS