MultiView.NextViewCommandName フィールド
アセンブリ: System.Web (system.web.dll 内)


NextViewCommandName フィールドを使用して、"NextView" コマンド名を表します。
このフィールドの値を使用して、MultiView コントロールに備わっている、アクティブな View コントロールの自動更新機能を利用できます。たとえば、前の View に移動する Button コントロールが View コントロールに格納されている場合は、CommandName プロパティに NextViewCommandName フィールドの値、つまり "NextView" を設定できます。これにより、ボタンがクリックされると、MultiView コントロールは ActiveViewIndex プロパティの値を自動的に減分します。

MultiView コントロールを使用して基本調査を作成する方法のコード例を次に示します。各 View コントロールは、個別の調査質問です。PreviousViewCommandName フィールドと NextViewCommandName フィールドは、それぞれに調査の前および次の View コントロールに自動的に移動するために使用します。
<%@ 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>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


MultiView クラス
MultiView メンバ
System.Web.UI.WebControls 名前空間
View
PreviousViewCommandName
SwitchViewByIDCommandName
SwitchViewByIndexCommandName
その他の技術情報
MultiView Web サーバー コントロールおよび View Web サーバー コントロール
- MultiView.NextViewCommandName フィールドのページへのリンク