RadioButtonList.CreateControlStyle メソッド
アセンブリ: System.Web (system.web.dll 内)

Dim returnValue As Style returnValue = Me.CreateControlStyle
コントロールのスタイルのプロパティを格納する Style。


カスタム サーバー コントロールの CreateControlStyle メソッドをオーバーライドして、常に RadioButtonList コントロールに空の TableStyle オブジェクトが返されるようにする方法のコード例を次に示します。
<%@ Page Language="VB" AutoEventWireup="True" %> <%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.VB.Controls" Assembly="Samples.AspNet.VB" %> <HTML> <HEAD><title>Custom RadioButtonList - CreateControlStyle - VB.NET Example</title> </HEAD> <body> <form id="Form1" method="post" runat="server"> <h3>Custom RadioButtonList - CreateControlStyle - VB.NET Example</h3> <aspSample:CustomRadioButtonListCreateControlStyle id="Radiobuttonlist1" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"> <asp:ListItem Value="Item1">Item1</asp:ListItem> <asp:ListItem Value="Item2">Item2</asp:ListItem> <asp:ListItem Value="Item3">Item3</asp:ListItem> <asp:ListItem Value="Item4">Item4</asp:ListItem> </aspSample:CustomRadioButtonListCreateControlStyle> </form> </body> </HTML> <br /><span space="preserve">...</span><br />Imports System.Web Imports System.Security.Permissions Namespace Samples.AspNet.VB.Controls <AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Minimal)> _ Public NotInheritable Class CustomRadioButtonListCreateControlStyle Inherits System.Web.UI.WebControls.RadioButtonList Protected Overrides Function CreateControlStyle() As System.Web.UI.WebControls.Style ' Initializes and return a new instance of the TableStyle class. Return New System.Web.UI.WebControls.TableStyle(Me.ViewState) End Function End Class End Namespace
<%@ Page Language="C#" AutoEventWireup="True" %> <%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.CS.Controls" Assembly="Samples.AspNet.CS" %> <HTML> <HEAD> <title>Custom RadioButtonList - CreateControlStyle - C# Example</title> </HEAD> <body> <form id="Form1" method="post" runat="server"> <h3>Custom RadioButtonList - CreateControlStyle - C# Example</h3> <aspSample:CustomRadioButtonListCreateControlStyle id="Radiobuttonlist1" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"> <asp:ListItem Value="Item1">Item1</asp:ListItem> <asp:ListItem Value="Item2">Item2</asp:ListItem> <asp:ListItem Value="Item3">Item3</asp:ListItem> <asp:ListItem Value="Item4">Item4</asp:ListItem> </aspSample:CustomRadioButtonListCreateControlStyle> </form> </body> </HTML> <br /><span space="preserve">...</span><br />using System.Web; using System.Security.Permissions; namespace Samples.AspNet.CS.Controls { [AspNetHostingPermission(SecurityAction.Demand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class CustomRadioButtonListCreateControlStyle : System.Web.UI.WebControls.RadioButtonList { protected override System.Web.UI.WebControls.Style CreateControlStyle() { // Initializes and return a new instance of the TableStyle class. return new System.Web.UI.WebControls.TableStyle(this.ViewState); } } }
<%@ Page Language="VJ#" AutoEventWireup="True" %> <%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.JSL.Controls" Assembly="Samples.AspNet.JSL" %> <HTML> <HEAD> <title>Custom RadioButtonList - CreateControlStyle - VJ# Example</title> </HEAD> <body> <form id="Form1" method="post" runat="server"> <h3>Custom RadioButtonList - CreateControlStyle - VJ# Example</h3> <aspSample:CustomRadioButtonListCreateControlStyle id="Radiobuttonlist1" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"> <asp:ListItem Value="Item1">Item1</asp:ListItem> <asp:ListItem Value="Item2">Item2</asp:ListItem> <asp:ListItem Value="Item3">Item3</asp:ListItem> <asp:ListItem Value="Item4">Item4</asp:ListItem> </aspSample:CustomRadioButtonListCreateControlStyle> </form> </body> </HTML> <br /><span space="preserve">...</span><br />package Samples.AspNet.JSL.Controls; public class CustomRadioButtonListCreateControlStyle extends System.Web.UI.WebControls.RadioButtonList { protected System.Web.UI.WebControls.Style CreateControlStyle() { // Initializes and return a new instance of the TableStyle class. return new System.Web.UI.WebControls.TableStyle(this.get_ViewState()); } //CreateControlStyle } //CustomRadioButtonListCreateControlStyle

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


RadioButtonList クラス
RadioButtonList メンバ
System.Web.UI.WebControls 名前空間
その他の技術情報
RadioButton Web サーバー コントロールおよび RadioButtonList Web サーバー コントロール
Weblioに収録されているすべての辞書からRadioButtonList.CreateControlStyle メソッドを検索する場合は、下記のリンクをクリックしてください。

- RadioButtonList.CreateControlStyle メソッドのページへのリンク