Compartir a través de


My.Response (objeto)

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

Observaciones

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

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

Ejemplo

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