次の方法で共有


My.Response オブジェクト

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

注釈

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>

こちらも参照ください