ASP.Net/Response/Content

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Checking Content Type (VB.net)

<%@ Page Language="vb" %>
<html>
   <head>
      <title>Checking Content Type in ASP.NET</title>
      <script runat="server">
         Sub Page_Load()
            Message.Text = "Current content type is " & _
               Response.ContentType & "</br>"
         End Sub
      </script>
   </head>
<body>
   <asp:label id="Message" runat="server"/>
</body>
</html>



Suppressing content (VB.net)

<%@ Page Language="vb" %>
<html>
   <head>
      <title>Suppressing content in ASP.NET</title>
      <script runat="server">
         Sub Page_Load()
            Response.Write("nfex.ru!")
            Response.SuppressContent = True
            If Response.SuppressContent Then Response.Close()
         End Sub
      </script>
   </head>
<body>
   <asp:label id="Message" runat="server"/>
</body>
</html>