HttpResponse.Output プロパティ
アセンブリ: System.Web (system.web.dll 内)

public TextWriter Output { get; }
public: property TextWriter^ Output { TextWriter^ get (); }
/** @property */ public TextWriter get_Output ()
クライアントへのカスタム出力を有効にしている TextWriter オブジェクト。

次のコード例の ASP.NET ページには、TextMode プロパティが MultiLine に設定された TextBox コントロールがあります。このページのコードは、ユーザーが TextMode で入力したテキストを受け取り、htm HtmlEncode メソッドを使用してそれを HTML エンコードに変換し、Output プロパティを使用してエンコードされた文字列をページに表示します。
<%@ Page Language="VB" %> <script runat="server"> ' When the page is posted back, the text box's ' Text property value is HTML encoded and sent ' sent to the current response. Private Sub btnSubmit_Click(sender As Object, e As EventArgs) If (IsPostBack = True) Server.HtmlEncode(txtSubmitString.Text, Response.Output) End If End Sub </script> <html> <head> </head> <body> <form runat="server"> <p> <font face="Tahoma" size="2">Enter your comments here:</font> </p> <p> <asp:TextBox id="txtSubmitString" runat="server" Width="181px" TextMode="MultiLine"></asp:TextBox> </p> <p> <asp:Button id="btnSubmit" onclick="btnSubmit_Click" runat="server" Text="Submit"></asp:Button> </p> <p> <asp:Label id="lblEncodedString" runat="server"></asp:Label> </p> </form> </body> </html>
<%@ Page Language="C#" %> <script runat="server"> // When the page is posted back, the text box's // Text property value is HTML encoded and sent // sent to the current Response. void btnSubmit_Click(object sender, EventArgs e) { if (IsPostBack) { Server.HtmlEncode(txtSubmitString.Text, Response.Output); } } </script> <html> <head> </head> <body> <form runat="server"> <p> <font face="Tahoma" size="2">Enter your comments here:</font> </p> <p> <asp:TextBox id="txtSubmitString" runat="server" Width="181px" TextMode="MultiLine"></asp:TextBox> </p> <p> <asp:Button id="btnSubmit" onclick="btnSubmit_Click" runat="server" Text="Submit"></asp:Button> </p> <p> <asp:Label id="lblEncodedString" runat="server"></asp:Label> </p> </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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からHttpResponse.Output プロパティを検索する場合は、下記のリンクをクリックしてください。

- HttpResponse.Output プロパティのページへのリンク