ErrorWebPart.AddAttributesToRender(HtmlTextWriter) Método
Definição
Aplica atributos de estilo de erro especiais a um objeto ErrorWebPart que é inserido em uma página no lugar de outro controle.Applies special error style attributes to an ErrorWebPart object that is inserted into a page in place of another control.
protected:
override void AddAttributesToRender(System::Web::UI::HtmlTextWriter ^ writer);
protected override void AddAttributesToRender (System.Web.UI.HtmlTextWriter writer);
override this.AddAttributesToRender : System.Web.UI.HtmlTextWriter -> unit
Protected Overrides Sub AddAttributesToRender (writer As HtmlTextWriter)
Parâmetros
- writer
- HtmlTextWriter
Um HtmlTextWriter que contém a saída HTML a ser renderizada.An HtmlTextWriter that contains the HTML output to be rendered.
Comentários
O AddAttributesToRender método usa as características de estilo (se houver) que são definidas no ErrorStyle objeto para a WebZone zona que contém um ErrorWebPart controle.The AddAttributesToRender method takes the style characteristics (if any) that are defined in the ErrorStyle object for the WebZone zone that contains an ErrorWebPart control. Os estilos são aplicados ao ErrorWebPart controle antes da renderização.The styles are applied to the ErrorWebPart control prior to rendering.
Notas aos Herdeiros
Esse método pode ser substituído em uma ErrorWebPart classe derivada, se os desenvolvedores quiserem personalizar as características de estilo que são aplicadas a um ErrorWebPart controle.This method can be overridden in a derived ErrorWebPart class, if developers want to customize the style characteristics that are applied to an ErrorWebPart control.
Para exigir que o WebPartManager controle use um ErrorWebPart controle personalizado, você também deve herdar da WebPartManager classe e substituir seu CreateErrorWebPart(String, String, String, String, String) método.To require the WebPartManager control to use a custom ErrorWebPart control, you must also inherit from the WebPartManager class and override its CreateErrorWebPart(String, String, String, String, String) method. Nesse método, você deve atribuir o valor do parâmetro do método errorMessage à ErrorMessage Propriedade do seu ErrorWebPart controle personalizado, pois o WebPartManager controle chama esse método de vários outros locais e geralmente passa em uma mensagem de erro específica.In that method, you should assign the value of the method's errorMessage parameter to the ErrorMessage property of your custom ErrorWebPart control, because the WebPartManager control calls this method from several other places, and usually passes in a specific error message.