My.Response (Objeto)

Obtiene el objeto HttpResponse asociado con Page. Este objeto permite enviar datos de respuesta HTTP a un cliente y contiene información sobre esa respuesta.

Comentarios

El objeto My.Response contiene el objeto HttpResponse actual asociado con la página.

El objeto My.Response solo está disponible para las aplicaciones ASP.NET.

Ejemplo

En el ejemplo siguiente, se obtiene la colección de encabezados del objeto My.Request y se usa el objeto My.Response para escribirla en la página 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>

Consulte también