ASP.Net/Asp Control/Literal

Материал из .Net Framework эксперт
Версия от 11:52, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

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>