Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
Tradução
Original
Este tópico ainda não foi avaliado como - Avalie este tópico

ContentPlaceHolder Classe

Defines a region for de conteúdo in an ASP.NET Mestre página.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (em System.Web. dll)

[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class ContentPlaceHolder : Control, INamingContainer

Um ContentPlaceHolder controle define uma região relativa para o conteúdo em uma master page e processa todo o texto, marcação e controles de servidor de um Content controle localizado em uma página de conteúdo.

A Content control is associated with a ContentPlaceHolder using its ContentPlaceHolderID property.Set the ContentPlaceHolderID property to the value of the ID property of the related ContentPlaceHolder control in a master page.More than one ContentPlaceHolder can be declared in a master page.

Within a content page, only one Content control can supply the content for a ContentPlaceHolder in the master page.However, in each content page that uses a master page, you can have separate Content controls associated with the ContentPlaceHolder.For example, you can define the ContentPlaceHolder for the page title in a master page.For each content page that uses the master page, you can add a Content control that supplies the text and markup for the page title.

Observação:

Para conformidade XHtml, um elemento de título vazio é criado se um título não foi definido ou não pode ser encontrado.

You can specify default content placed within the ContentPlaceHolder control tags, but this content is replaced by any content in an associated content page.

For more information about master pages and content pages, see Páginas Mestras do ASP.NET.

The following code example shows how the ContentPlaceHolder control is used to define a content region for a master page.The first Web page is a master page, and defines a content region using a ContentPlaceHolder control.

<%@ Master Language= %>
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head runat=>
    <title>MasterPage Example</title>
</head>
<body>
    <form id= runat=>
    <div>
        <asp:contentplaceholder id= runat= />
    </div>
    </form>
</body>
</html>


The seguinte exemplo de código demonstrates a página de conteúdo for the acima Mestre página.The text, markup, and any server controls defined within the Content control template are rendered to the ContentPlaceHolder on the master page.

  SampleMasterClass : System.Web.UI.MasterPage {
      string sitename;     
      string SiteName
     {
         {(sitename);}
         {sitename = value;}
     }
}


System.Object
  System.Web.UI.Control
    System.Web.UI.WebControls.ContentPlaceHolder
Quaisquer membros públicos estático (compartilhados na Visual Basic) desse tipo são Thread seguro. Não há garantia de que qualquer membro de instância seja isento de segmentos.
Isso foi útil para você?
(1500 caracteres restantes)

Contribuições da comunidade

ADICIONAR
© 2013 Microsoft. Todos os direitos reservados.