How to use
Data has been provided for your use with this sample. It can be found at
<Your ArcGIS Developer Kit Install directory>/Samples/data/Usa/USA.mxd.
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 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 Developer Kit install location>\Samples\ServerNET\Common_PostbackManager.
- Open the folder of the language you're going to use—CSharp or VBNet—and copy the Common_PostbackManager_<language> folder to c:\inetpub\wwwroot. The <language> variable can be either CSharp or VBNet.
- Open the IIS Manager from Control Panel > Administrative Tools > Internet Information Services (IIS) Manager or Internet Information Services.
- In the console tree view on the left, navigate to Local Computer > Web Sites > Default Web Site, expand Default Web Site and the Common_PartialPostback_<language> folder, right-click the PostbackManagerWebSite folder, and click Properties. The Properties dialog box opens.
- Click the Directory tab, click the Create button in the Application Settings section, then click OK to close the Properties dialog box.
- Start Microsoft Visual Studio 2008 or 2010, and open the solution for the version of Visual Studio you're using. The Visual Studio version is appended to the solution file name. For example, the Visual Studio 2008 solution file for the Common_PostbackManager_CSharp sample is Common_PostbackManager_CSharp2008.sln and is located in the c:\inetpub\wwwroot\Common_PostbackManager_CSharp folder.
- In Solution Explorer, right-click the page you want to view and select Set As Start Page.
- The pages in this sample are configured to use the USA map service, and it is assumed that this is running on your local machine (localhost). You can create this service by publishing the map document located at <ArcGIS Developer Kit install location>\Samples\data\Usa\USA.mxd. For instructions on how to publish a map document to ArcGIS Server, see the Publishing a GIS resource to the server topic in the ArcGIS Server Help.
- If this service is not running on the local machine, you must specify the proper location. To do this, open the page you want to view in Design view, click the MapResourceManager control, and click the ellipsis next to the ResourceItems property in the properties window. The ResourceItem Collection Editor dialog box opens.
- Click the ellipsis next to the Definition property. The MapResource Definition Editor dialog box opens.
- In the Data Source field, replace localhost with the name of the machine hosting the service.
- Save the project.
- Click the Debug drop-down menu and click Start Debugging.
Run ProgressBarOnRequest.aspx
- Use the controls on the page to zoom the map, execute the Query Counties task, toggle layers in the TOC, and so on. A progress bar often appears in the lower right corner of the map. The progress bar is shown when a Web ADF control issues a request via the PostbackManager invokingRequest event and is hidden when a response is received via the requestProcessed event.
Run CreateGraphicElement.aspx
- Press and hold the A key and click several points on the map. Point features with varying sizes and symbology appear at the clicked points. The geometries for these points are sent to the server through the PostbackManager doAsyncRequest method. Then, in a handler for the Web tier RequestReceived event, these points are used to create GraphicElements, which are added to a GraphicsLayer and displayed on the map. With the Line or Polygon check box checked, feature geometries of the corresponding type are similarly captured on the client and processed on the server.
Run GetAttributeTable.aspx
- Check the Get Layer Attribute Data check box.
- Expand the MapResourceItem node on the TOC.
- In the TOC, click the States Layer. A progress indicator is displayed above the TOC, followed by a FloatingPanel containing a table showing the attributes of features in the States layer. A handler for the PostbackManager invokingRequest event is used to intercept and add an argument to the request generated by the TOC when a layer is clicked. In the Web tier, a handler for the RequestReceived event checks for this argument and, when found, queries the clicked layer and generates the attribute table. Once a response is received on the client, a handler for the requestProcessed event applies a title to the FloatingPanel containing the attribute table.
- Click the paging buttons. The first, last, subsequent, and previous pages of attributes can be quickly retrieved.
- Click a column heading. The table is sorted on the clicked column. These functions all use the PostbackManager doAsyncRequest method to issue an asynchronous request, which is then processed in the Web tier by a handler for the PostbackManager RequestReceived event.
Common_PostbackManager_CSharp\PostbackManagerWebSite\ProgressBarOnRequest.aspx | Displays a progress bar when a Web ADF control issues a request. |
Common_PostbackManager_CSharp\PostbackManagerWebSite\CreateGraphicElement.aspx | Captures geometries drawn on the client and sends them to the server. |
Common_PostbackManager_CSharp\PostbackManagerWebSite\CreateGraphicElement.aspx.cs | Code behind the user interface. |
Common_PostbackManager_CSharp\PostbackManagerWebSite\GetAttributeTable.aspx | Displays an attribute table when a layer is clicked in the TOC. |
Common_PostbackManager_CSharp\PostbackManagerWebSite\GetAttributeTable.aspx.cs | Code behind the user interface. |
Common_PostbackManager_CSharp\PostbackManager_CSharp\PostbackManager.cs | Implementation of the PostbackManager control's Web-tier functionality. |
Common_PostbackManager_CSharp\PostbackManager_CSharp\JavaScript\PostbackManager.js | Implementation of the PostbackManager control's client-tier functionality. |
Common_PostbackManager_VBNet\PostbackManagerWebSite\ProgressBarOnRequest.aspx | Displays a progress bar when a Web ADF control issues a request. |
Common_PostbackManager_VBNet\PostbackManagerWebSite\CreateGraphicElement.aspx | Captures geometries drawn on the client and sends them to the server. |
Common_PostbackManager_VBNet\PostbackManagerWebSite\CreateGraphicElement.aspx.vb | Code behind the user interface. |
Common_PostbackManager_VBNet\PostbackManagerWebSite\GetAttributeTable.aspx | Displays an attribute table when a layer is clicked in the TOC. |
Common_PostbackManager_VBNet\PostbackManagerWebSite\GetAttributeTable.aspx.vb | Code behind the user interface. |
Common_PostbackManager_VBNet\PostbackManager_VBNet\PostbackManager.vb | Implementation of the PostbackManager control's Web-tier functionality. |
Common_PostbackManager_VBNet\PostbackManager_VBNet\JavaScript\PostbackManager.js | Implementation of the PostbackManager control's client-tier functionality. |
Download the files for all languages