How to use
If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.
At design time
- Verify that the Web Application Developer Framework (ADF) for the .NET Framework is installed and functioning properly. For information on installing and configuring the Web ADF, consult the installation guide.
- In Windows Explorer, navigate to <ArcGIS install location>\DeveloperKit10.0\Samples\ServerNet. This folder contains the Common_ContextMenu with CSharp and VBNet folders.
- Open the folder of the language you're going to use—CSharp or VBNet—and copy the Common_ContextMenu_<language> folder to c:\inetpub\wwwroot. The <language> variable can be either CSharp or VBNet.
- Start Microsoft Visual Studio 2008 or 2010 and open the Common_ContextMenu_<language><vs_version> solution (for example, Common_ContextMenu_CSharp2008.sln) located in c:\inetpub\wwwroot\Common_ContextMenu_<language>. The <vs_version> references the Visual Studio version of the solution, either 2008 or 2010.
- For pages that contain a MapResourceManager, set the map resource item to a valid resource, and reconfigure any tasks present in the page if they need to work with this resource.
- In Solution Explorer, right-click the page you want to view, and select Set As Start Page.
At run time
- Start the sample application.
- In SimpleMap.aspx, right-click the map and select Zoom In.
- In SimpleToc.aspx, right-click a layer in the TOC and select Show Fields.
- Hover over a layer. The layer text displays in red.
- Right-click the background of the layer node. It turns light blue.
- Click Show Fields. The background is reset to the original color, and a list of fields is displayed below the Map control.
- In SimpleTaskResults.aspx, display the search attributes task dialog, enter a search string, and execute. If the results contain feature nodes (nodes that represent individual features) right-click the node and select Remove or Remove Node. The node is removed. Remove is part of the TaskResults feature context menu while Remove Node was added explicitly.
- Click a tool in the toolbar to add a custom node with associated context menu to the TaskResults control.
- Right-click the node and select Show Alert or Remove. Both are handled in the ItemClicked event on the ContextMenu.
- SimpleTask.aspx merely operated as a container for a custom task that associated context menus with results. Display the custom task dialog and enter a value to display in the TaskResults control. The results include the time on the server.
- Right-click the server time and select Show Alert or Remove. Both are handled in the custom task, in the ItemClicked event on the ContextMenu.
Common_ContextMenu_CSharp\SimpleMap.aspx | Page contains a map with a ContextMenu. |
Common_ContextMenu_CSharp\SimpleMap.aspx.cs | Code behind. |
Common_ContextMenu_CSharp\SimpleTask.aspx | Page contains a map, a TaskResults control, and a custom task with a ContextMenu. |
Common_ContextMenu_CSharp\SimpleTask.aspx.cs | Code behind. |
Common_ContextMenu_CSharp\SimpleTaskResults.aspx | Page contains a map, and Toolbar, TaskResults, and ContextMenu controls. |
Common_ContextMenu_CSharp\SimpleTaskResults.aspx.cs | Code behind. |
Common_ContextMenu_CSharp\SimpleToc.aspx | Page contains a map and TOC. ContextMenus are configured on TOC contents. |
Common_ContextMenu_CSharp\SimpleToc.aspx.cs | Code behind. |
Common_ContextMenu_CSharp\App_Code\SimpleTaskContextMenu_CSharp.cs | Custom task that contains ContextMenus, adds them to results, and handles ContextMenu events. |
Common_ContextMenu_CSharp\App_Code\Utility.cs | Utility classes for the custom task. |
Common_ContextMenu_VBNet\SimpleMap.aspx | Page contains a map with a ContextMenu. |
Common_ContextMenu_VBNet\SimpleMap.aspx.vb | Code behind. |
Common_ContextMenu_VBNet\SimpleTask.aspx | Page contains a map, a TaskResults control, and a custom task with a ContextMenu. |
Common_ContextMenu_VBNet\SimpleTask.aspx.vb | Code behind. |
Common_ContextMenu_VBNet\SimpleTaskResults.aspx | Page contains a map, and Toolbar, TaskResults, and ContextMenu controls. |
Common_ContextMenu_VBNet\SimpleTaskResults.aspx.vb | Code behind. |
Common_ContextMenu_VBNet\SimpleToc.aspx | Page contains a map and TOC. ContextMenus are configured on TOC contents. |
Common_ContextMenu_VBNet\SimpleToc.aspx.vb | Code behind. |
Common_ContextMenu_VBNet\App_Code\SimpleTaskContextMenu_VBNet.vb | Custom task that contains ContextMenus, adds them to results, and handles ContextMenu events. |
Common_ContextMenu_VBNet\App_Code\Utility.vb | Utility classes for the custom task. |
Download the files for all languages