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


RenderAttributes メソッドは、HtmlTextArea コントロールの name 属性を直接レンダリングし、Control.UniqueID プロパティと値が同じになるようにします。属性をレンダリングした後、RenderAttributes メソッドは基本クラスの RenderAttributes メソッドを呼び出します。
RenderAttributes メソッドは、主に、コントロール開発者が HtmlTextArea コントロールの機能を拡張する際に使用します。

HtmlTextArea コントロールに特定のタイトル テキストが常に表示されるように、カスタム サーバー コントロールの RenderAttributes メソッドをオーバーライドする方法を次のコード例に示します。
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.VB.Controls" Assembly="Samples.AspNet.VB" %> <%@ Page Language="VB" AutoEventWireup="True" %> <script runat="server"> Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) HtmlTextArea1.Value = "Hello HTML Text Area World." End Sub </script> <html> <head> <title>Custom HtmlTextArea RenderAttributes Example</title> </head> <body> <form id="Form1" method="post" runat="server"> <h3>Custom HtmlTextArea RenderAttributes Example</h3> <aspSample:CustomHtmlTextAreaRenderAttributes id="HtmlTextArea1" name="HtmlTextArea1" runat="server" rows="4" cols="50" /> </form> </body> </html>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.CS.Controls" Assembly="Samples.AspNet.CS" %> <%@ Page Language="C#" AutoEventWireup="True" %> <script runat="server"> void Page_Load(Object sender, EventArgs e) { HtmlTextArea1.Value = "Hello HTML Text Area World."; } </script> <html> <head> <title>Custom HtmlTextArea RenderAttributes Example</title> </head> <body> <form id="Form1" method="post" runat="server"> <h3>Custom HtmlTextArea - RenderAttributes - C# Example</h3> <aspSample:CustomHtmlTextAreaRenderAttributes id="HtmlTextArea1" name="HtmlTextArea1" runat="server" rows="4" cols="50" /> </form> </body> </html>
Imports System.Web Imports System.Security.Permissions Namespace Samples.AspNet.VB.Controls <AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Minimal)> _ Public NotInheritable Class CustomHtmlTextAreaRenderAttributes Inherits System.Web.UI.HtmlControls.HtmlTextArea Protected Overrides Sub RenderAttributes(ByVal writer As System.Web.UI.HtmlTextWriter) ' Write out the Title attribute. writer.Write(" Title=""Text from RenderAttributes.""") ' Call the base class's RenderAttributes method. MyBase.RenderAttributes(writer) End Sub End Class End Namespace
using System.Web; using System.Security.Permissions; namespace Samples.AspNet.CS.Controls { [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)] public sealed class CustomHtmlTextAreaRenderAttributes : System.Web.UI.HtmlControls.HtmlTextArea { protected override void RenderAttributes(System.Web.UI.HtmlTextWriter writer) { // Write out the Title attribute. writer.Write(" Title=\"Text from RenderAttributes.\""); // Call the base class's RenderAttributes method. base.RenderAttributes(writer); } } }

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


Weblioに収録されているすべての辞書からHtmlTextArea.RenderAttributes メソッドを検索する場合は、下記のリンクをクリックしてください。

- HtmlTextArea.RenderAttributes メソッドのページへのリンク