ASP.Net/Asp Control/Literal — различия между версиями

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

Текущая версия на 11:52, 26 мая 2010

asp:Literal: Mode Encode (C#)

<%@ Page Language="C#" %>
<html>
<head>
    <title>Show Literal Mode</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    <asp:Literal
        id="ltlFirst"
        Mode="PassThrough"
        Text="<hr />"
        Runat="server" />
    <asp:Literal
        id="ltlSecond"
        Mode="Encode"
        Text="<hr />"
        Runat="server" />
    <asp:Literal
        id="ltlThird"
        Mode="Transform"
        Text="<hr />"
        Runat="server" />
    
    </div>
    </form>
</body>
</html>



asp:Literal mode PassThrough (VB.net)

<%@ Page Language="C#" %>
<html>
<head>
    <title>Show Literal Mode</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    <asp:Literal
        id="ltlFirst"
        Mode="PassThrough"
        Text="<hr />"
        Runat="server" />
    <asp:Literal
        id="ltlSecond"
        Mode="Encode"
        Text="<hr />"
        Runat="server" />
    <asp:Literal
        id="ltlThird"
        Mode="Transform"
        Text="<hr />"
        Runat="server" />
    
    </div>
    </form>
</body>
</html>



asp:Literal Mode Transform (C#)

<%@ Page Language="C#" %>
<html>
<head>
    <title>Show Literal Mode</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    <asp:Literal
        id="ltlFirst"
        Mode="PassThrough"
        Text="<hr />"
        Runat="server" />
    <asp:Literal
        id="ltlSecond"
        Mode="Encode"
        Text="<hr />"
        Runat="server" />
    <asp:Literal
        id="ltlThird"
        Mode="Transform"
        Text="<hr />"
        Runat="server" />
    
    </div>
    </form>
</body>
</html>



asp:literal (VB.net)

<%@ Page Language="vb" %>
<html>
<head>
   <title>Declarative Control Example</title>
   <script runat="server">
      Sub Page_Load()
         Message.Text = "This text set from Page_Load!"
      End Sub
   </script>
</head>
<body>
   <form runat="server">
      <asp:literal id="Message" runat="server"/>
   </form>
</body>
</html>