WebPartHelpMode 枚举

定义

指定用于显示 WebPart 控件的帮助内容的用户界面 (UI) 的可用类型。Specifies the available types of user interfaces (UIs) for displaying Help content for a WebPart control.

public enum class WebPartHelpMode
public enum WebPartHelpMode
type WebPartHelpMode = 
Public Enum WebPartHelpMode
继承
WebPartHelpMode

字段

Modal 0

打开一个单独的浏览器窗口(如果浏览器具有此功能)。Opens a separate browser window, if the browser has this capability. 用户在返回到 Web 部件页之前必须关闭该窗口。A user must close the window before returning to the Web Parts page.

Modeless 1

打开一个单独的浏览器窗口(如果浏览器具有此功能)。Opens a separate browser window, if the browser has this capability. 用户在返回到网页之前无需关闭该窗口。A user does not have to close the window before returning to the Web page.

Navigate 2

替换浏览器窗口中的“Web 部件”页。Replaces the Web Parts page in the browser window.

示例

下面的示例演示如何使用WebPart.HelpMode属性在同一浏览器窗口中显示控件的帮助。The following example demonstrates the use of the WebPart.HelpMode property to display Help for a control in the same browser window. 此示例的第一部分假定使用自定义控件, 该控件TextDisplayWebPart位于WebPart类的 "示例" 部分。The first part of this example assumes the use of a custom control, TextDisplayWebPart, which is found in the Examples section of the WebPart class.

该示例还包含一个 HTML 页面, 其中包含TextDisplayWebPart控件的虚拟帮助内容。The example also includes an HTML page that contains fictitious Help content for the TextDisplayWebPart control. 要使此示例正常运行, 必须将以下代码保存到名为 Textwebparthelp 的文件中, 并将其放置在站点的同一目录中。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>  

示例的最后一部分是显示如何引用TextDisplayWebPart控件的网页。The final part of the example is a Web page that shows how to reference the TextDisplayWebPart control. 请注意, 在声明性标记中WebPart.HelpMode , 属性值设置为Navigate, 代码还将WebPart.HelpUrl属性的值设置为包含帮助内容的 HTML 文件的名称。Note that in the declarative markup, the WebPart.HelpMode property value is set to Navigate, and the code also sets the value of the WebPart.HelpUrl property to the name of the HTML file that contains the Help content. 将页面加载到浏览器, 并单击WebPart控件的谓词菜单上的 "帮助" 谓词。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>

注解

HelpMode属性用于确定浏览器显示控件的帮助内容的方式。The HelpMode property is used to determine how a browser will display Help content for a control. 枚举包含可应用HelpMode于属性的值。 WebPartHelpModeThe WebPartHelpMode enumeration contains values that can be applied to the HelpMode property. HelpMode属性的默认值为模式。The default value for the HelpMode property is Modal.

适用于