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

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

MultiView.SwitchViewByIDCommandName フィールド

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

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

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

Public Shared ReadOnly SwitchViewByIDCommandName
 As String
Dim value As String

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

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

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

使用例使用例

MultiView コントロール使用して基本調査作成する方法コード例次に示します。各 View コントロールは、個別調査質問です。PreviousViewCommandName フィールドと NextViewCommandName フィールドは、それぞれに調査の前および次の View コントロール自動的に移動するために使用しますユーザー調査最後View の [Retake Survey] ボタンクリックすると、SwitchViewByIDCommandName フィールドコマンド引数 "Page1" と共に使用されユーザー調査最初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.NextViewCommandName Example</title>
</head>
<body>
    <form ID="Form1" runat="Server">
        
      <h3>MultiView.NextViewCommandName 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="SwitchViewByID"
            commandargument="Page1"
            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.NextViewCommandName Example</title>
</head>
<body>
    <form ID="Form1" runat="Server">
        
      <h3>MultiView.NextViewCommandName 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="SwitchViewByID"
            commandargument="Page1"
            Height="25"
            Width="110"
            runat= "Server">
          </asp:Button>                    
                    
        </asp:View>  
       
      </asp:MultiView>
        
    </asp:Panel> 

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


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS