My.Response オブジェクト

Page に関連付けられた HttpResponse オブジェクトを取得します。 このオブジェクトでは、HTTP 応答データをクライアントに送信し、その応答に関する情報を含めることができます。

Remarks

My.Response オブジェクトには、ページに関連付けられている現在の HttpResponse オブジェクトが含まれています。

My.Response オブジェクトは、ASP.NET アプリケーションでのみ使うことができます。

次の例では、My.Request オブジェクトからヘッダー コレクションを取得し、My.Response オブジェクトを使用して ASP.NET ページに書き込みます。

<script runat="server">
    Public Sub ShowHeaders()
        ' Load the header collection from the Request object.
        Dim coll As System.Collections.Specialized.NameValueCollection
        coll = My.Request.Headers

        ' Put the names of all keys into a string array.
        For Each key As String In coll.AllKeys
            My.Response.Write("Key: " & key & "<br>")

            ' Get all values under this key.
            For Each value As String In coll.GetValues(key)
                My.Response.Write("Value: " & _
                    Server.HtmlEncode(value) & "<br>")
            Next
        Next
    End Sub
</script>

関連項目