PageLayout control


In this topic


About the PageLayout control

Use the PageLayout control to display the layout on a map document served through ArcGIS Server. A layout is typically created in a map document for printing or displaying a map and related items. You can print the layout page displayed in the Web browser.
A toolbar can be included on the page and tools added at design time. These tools allow you to interact with the layout. Standard tools can be added that allow zooming and panning the layout page, as well as zooming and panning the map.
Unlike the Map control, the PageLayout control does not use an associated MapResourceManager. Instead, the resource information is set in the properties of the PageLayout control.

Using the control

  1. To add controls to the page, open or create a Web site in Visual Studio. Open a Web form in design mode, select the Toolbox panel, and expand the ArcGIS Web Controls tab. Drag and drop a PageLayout control and optionally, a Toolbar control onto the Web form. See the following screen shot that shows the page in Visual Studio:

    PageLayout control in Visual Studio  

    If you added a Toolbar control, set its BuddyControlType property to PageLayout and add the previously added PageLayout control to the BuddyControls collection, then add one or more tools to the toolbar. When the buddy control is a page layout, the tools include zoom and pan on the page, and zoom and pan on the map.
  2. To set PageLayout properties, select the PageLayout control. Do the following on the Properties window:
    1. Select the value for the PageLayoutResource property and click the ellipsis button. See the following screen shot:

      PageLayout properties 
    2. When you click the PageLayoutResource ellipsis button on the Properties window, the following GIS Page Layout Resource Definition Editor dialog box appears:


    3. Click the Type drop-down arrow and select ArcGIS Server Local.
    4. Click the Data Source ellipsis button or type the name of the ArcGIS Server machine.
    5. Click the Resource ellipsis button to set the resource used to an available service.
    6. Click OK.
    7. Resize the PageLayout control to an acceptable size and select it on the page. Click and hold the cursor over a handle on a side or corner of the control, then drag the control to an acceptable size. By default, the position of the controls added in Visual Studio at design time are not set. As a result, the controls are permitted to flow left-to-right on a line and top-to-bottom on the page. For more information, see Visual Studio 2005 and 2008 integration.
  3. Web sites using an ArcGIS Server Local resource must contain an ArcGIS identity to enable use of the resource. To add an identity, right-click the Web application in the Solution Explorer, then click Add ArcGIS Identity. The Add ArcGIS Identity dialog box appears.
  4. On the dialog box, type the user name, password, and domain or machine name, then click OK to insert the identity, which is stored in the web.config file for the application.
    • The identity must be a member of the agsusers group on the server object manager (SOM) machine. One identity is allowed per application; therefore, if your application connects to multiple local servers, make sure the identity account is in the agsusers group on all servers.
    • If an appropriate identity is not added to the application, an error message appears at runtime.

Tables not exported with layout

Tables included in a layout in the ArcMap document are not included in the exported layout.

Members

The following table shows a list of properties related to the PageLayout control. For more reference information, see the PageLayout control in the library reference section.
Property name
Type
Description
ClientToolGraphicsColor
color
Color of the box drawn on the Map and PageLayout controls' display while using the DragRectangle or PageDragRectangle Client Action tools (for example, when zooming in and out).
ClientToolGraphicsWidth
int
Line width of shapes dragged on the Map and PageLayout controls when using a tool.
EnableContinuousCallback
bool
Determines if images are fetched continuously during panning on the map or only when panning is complete.
ImageFormat
WebImageFormat
Format of the output image.
InitialExtent
IntialExtent
Initial extent a control first renders.
PageLayoutReference
GISResourceItemDefinition
MapResource that shows on the PageLayout.
ToolItems
PageToolItemCollection
Collection of tool items.
UseMimeData
bool
If set to true, stores output images in session and streams them to the client, or stores them on the file system.
VirtualDirectory
string
Path to the virtual directory in which images can be written, for example, ~/output/.

Events

The following table shows a list of events related to the PageLayout control. For more reference information, see the PageLayout control in the library reference section.
Event type
Description
BeginCreateWebPageLayout
Raised before a WebPageLayout is created.
BeginDisposeWebPageLayout
Raised before a WebPageLayout is disposed.
BeginRefreshWebPageLayout
Raised before a WebPageLayout is refreshed.
ContentsChanged
Raised when the contents of this control (for example, the extent) are changed.
DragImage
Raised when the control processes a tool associated with the DragImage Client Tool Action.
DragRectangle
Raised when the control processes a tool associated with the DragRectangle Client Tool Action.
EndCreateWebPageLayout
Raised after a WebPageLayout is created.
EndDisposeWebPageLayout
Raised after a WebPageLayout is disposed.
EndRefreshWebPageLayout
Raised after a WebPageLayout is refreshed.
MapDragImage
Raised when the control processes a tool associated with the MapDragImage Client Tool Action.
MapDragRectangle
Raised when the control processes a tool associated with the MapDragRectangle Client Tool Action.
MapPoint
Raised when the control processes a tool associated with the MapPoint Client Tool Action.
PageClick
Raised when the PageLayout control has been clicked.
Point
Raised when the control processes a tool associated with the Point Client Tool Action.
ScaleChanged
Raised when the scale on the layout has changed.


See Also:

Visual Studio 2005 and 2008 integration
Web ADF controls
Customizing the Web Mapping application




To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):
  • ESRI.ArcGIS.ADF.Web.UI.WebControls.Layout.dll