WebPart.HelpUrl Propriedade
Definição
public:
virtual property System::String ^ HelpUrl { System::String ^ get(); void set(System::String ^ value); };
[System.Web.UI.Themeable(false)]
[System.Web.UI.WebControls.WebParts.Personalizable(System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared)]
public virtual string HelpUrl { get; set; }
[<System.Web.UI.Themeable(false)>]
[<System.Web.UI.WebControls.WebParts.Personalizable(System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared)>]
member this.HelpUrl : string with get, set
Public Overridable Property HelpUrl As String
Valor da propriedade
Uma cadeia de caracteres que representa a URL para um arquivo de ajuda.A string that represents the URL to a Help file. O valor padrão é uma cadeia de caracteres vazia ("").The default value is an empty string ("").
- Atributos
Exceções
O sistema de validação interno determinou que a URL pode conter os ataques de script.The internal validation system has determined that the URL might contain script attacks.
Exemplos
O exemplo de código a seguir demonstra o uso da HelpUrl propriedade.The following code example demonstrates the use of the HelpUrl property. Este exemplo assume o uso de um controle personalizado, TextDisplayWebPart , que é encontrado na seção de exemplo da WebPart classe visão geral.This example assumes the use of a custom control, TextDisplayWebPart, which is found in the Example section of the WebPart class overview.
O exemplo de código também inclui uma página HTML que contém o conteúdo da ajuda fictícia para o TextDisplayWebPart controle.The code example also includes an HTML page that contains fictitious Help content for the TextDisplayWebPart control. Para que este exemplo funcione, você deve salvar o código a seguir em um arquivo chamado Textwebparthelp.htm e colocá-lo no mesmo diretório do site que a página. aspx.For this example to work, you must save the following code in a file named Textwebparthelp.htm and place it in the same directory of your site as the .aspx page.
<html>
<head runat="server">
<title>Text Content WebPart Help</title>
</head>
<body>
<div>
<h1>Text Content WebPart Help</h1>
To make the WebPart control work...
</div>
</body>
</html>
A parte final do exemplo é uma página da Web que mostra como fazer referência ao TextDisplayWebPart controle.The final part of the example is a Web page that shows how to reference the TextDisplayWebPart control. Observe que na marcação declarativa, o HelpMode valor da propriedade é definido como Navigate , e o código também define o valor da HelpUrl propriedade como o nome do arquivo HTML que contém o conteúdo da ajuda.Note that in the declarative markup, the HelpMode property value is set to Navigate, and the code also sets the value of the HelpUrl property to the name of the HTML file that contains the Help content. Carregue a página em um navegador e clique no verbo de ajuda no menu de verbos do WebPart controle.Load the page into a browser, and click the help verb on the verbs menu of the WebPart control.
<%@ page language="C#" %>
<%@ register tagprefix="aspSample"
Namespace="Samples.AspNet.CS.Controls"
Assembly="TextDisplayWebPartCS" %>
<!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>ASP.NET Example</title>
</head>
<body>
<form id="Form1" runat="server">
<asp:webpartmanager id="WebPartManager1" runat="server" />
<asp:webpartzone
id="WebPartZone1"
runat="server"
backcolor="#99cccc">
<parttitlestyle font-bold="true" forecolor="#ffffff" />
<partstyle
borderwidth="1px"
borderstyle="Solid"
bordercolor="#81AAF2" />
<zonetemplate>
<aspSample:TextDisplayWebPart
runat="server"
id="textwebpart"
title = "Text Content WebPart"
width="350px"
HelpMode="navigate"
HelpUrl="TextWebPartHelp.htm" />
</zonetemplate>
</asp:webpartzone>
</form>
</body>
</html>
<%@ page language="VB" %>
<%@ register tagprefix="aspSample"
Namespace="Samples.AspNet.VB.Controls"
Assembly="TextDisplayWebPartVB" %>
<!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>ASP.NET Example</title>
</head>
<body>
<form id="Form1" runat="server">
<asp:webpartmanager id="WebPartManager1" runat="server" />
<asp:webpartzone
id="WebPartZone1"
runat="server"
backcolor="#99cccc">
<parttitlestyle font-bold="true" forecolor="#ffffff" />
<partstyle
borderwidth="1px"
borderstyle="Solid"
bordercolor="#81AAF2" />
<zonetemplate>
<aspSample:TextDisplayWebPart
runat="server"
id="textwebpart"
title = "Text Content WebPart"
width="350px"
HelpMode="navigate"
HelpUrl="TextWebPartHelp.htm" />
</zonetemplate>
</asp:webpartzone>
</form>
</body>
</html>
Comentários
Para habilitar um menu de verbo com um verbo de ajuda no menu de verbos de um WebPart controle, você deve fornecer um valor para a HelpUrl propriedade.To enable a verb menu with a help verb in the verbs menu of a WebPart control, you must provide a value for the HelpUrl property. A maneira como o conteúdo da ajuda é exibido no navegador é determinada pelo valor da HelpMode propriedade.The manner in which the Help content is displayed in the browser is determined by the value of the HelpMode property.
Esta propriedade não pode ser definida por temas ou temas de folha de estilo.This property cannot be set by themes or style sheet themes. Para obter mais informações, consulte ThemeableAttribute e temas e capas do ASP.net.For more information, see ThemeableAttribute and ASP.NET Themes and Skins.
O escopo de personalização dessa propriedade é definido como Shared e pode ser modificado somente por usuários autorizados.The personalization scope of this property is set to Shared and can be modified only by authorized users. Para obter mais informações, consulte PersonalizableAttribute e Web Parts visão geral da personalização.For more information, see PersonalizableAttribute and Web Parts Personalization Overview.