Share via


Localize controle de servidor Web Declarative sintaxe

Cria um local em uma página da Web para exibir texto estático, localizado.

<asp:Localize
    EnableTheming="True|False"
    EnableViewState="True|False"
    ID="string"
    Mode="Transform|PassThrough|Encode"
    OnDataBinding="DataBinding event handler"
    OnDisposed="Disposed event handler"
    OnInit="Init event handler"
    OnLoad="Load event handler"
    OnPreRender="PreRender event handler"
    OnUnload="Unload event handler"
    runat="server"
    SkinID="string"
    Text="string"
    Visible="True|False"
/>

Comentários

Use o Localize controle para reservar um local em uma página da Web para exibir texto localizado. The Localize é idêntico ao controle de Literal controle e semelhante do Label controle. Enquanto o controle Label permite que você aplique um estilo ao texto exibido, o controle Localize não o permite. You can programmatically control the text that is displayed in the Localize control by setting the Text property, which is inherited from the Literal control.

Exemplo

O exemplo de código a seguir demonstra como usar o controle Localize para localizar um bloco de texto estático. Recursos de página na pasta App_LocalResource são usados para personalizar o texto para idiomas diferentes.

<%@ Page Language="VB" 
     Culture="auto" 
     meta:resourcekey="PageResource1" 
     UICulture="auto" %>
<!DOCTYPE html PUBLIC 
     "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Localize Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Localize id="Localize1"
     runat="server" 
     meta:resourcekey="Localize1Resource1" 
     Text="Hello World!">
</asp:Localize>
</div>
</form>
</body>
</html>
<%@ Page Language="C#" 
     Culture="auto" 
     meta:resourcekey="PageResource1" 
     UICulture="auto" %>
<!DOCTYPE html PUBLIC 
     "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Localize Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Localize id="Localize1"
     runat="server" 
     meta:resourcekey="Localize1Resource1" 
     Text="Hello World!">
</asp:Localize>
</div>
</form>
</body>
</html>

Consulte também

Referência

Localize