<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.esri.com/Dev/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">ArcGIS Server Blog</title><subtitle type="html" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.esri.com/Dev/blogs/arcgisserver/atom.aspx" /><generator uri="http://communityserver.org" version="2.1.61120.2">Community Server</generator><updated>2008-09-25T09:32:00Z</updated><entry><title>Developing scriptable controls with the .NET Web ADF</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/11/17/Developing-scriptable-controls-with-the-.NET-Web-ADF.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/11/17/Developing-scriptable-controls-with-the-.NET-Web-ADF.aspx</id><published>2008-11-17T19:18:00Z</published><updated>2008-11-17T19:18:00Z</updated><content type="html">&lt;P&gt;A key consideration when designing a custom web control is where the control’s logic will execute. While all the logic could be put in either the client or the web tier, the best approach is usually to place some logic in each tier. User interface data and operations should usually be situated in the client tier, while data retrieval and heavy computational logic should (and often must) reside in the web tier. Distributing the control in this way maximizes the use of client resources and reduces server load.&lt;/P&gt;
&lt;P&gt;Additionally, in order to minimize network traffic, client tier functionality should initiate server tier logic only when necessary (for example, to query a database housed in the web tier). Adhering to this architecture enables the development of controls with rich and responsive user interfaces.&lt;/P&gt;
&lt;P&gt;Given the advantages of this architecture, the question becomes one of implementation. How can you efficiently create an implementation that is intuitive, maintainable, extensible, and re-distributable? One effective approach is to create a scriptable ASP.NET server control that inherits from the Web ADF WebControl.&lt;/P&gt;Scriptable server controls offer a framework for combining server and client logic into one easily re-distributable control. This framework allows for the partitioning of client and server logic as described above while keeping that logic housed in one control and adherent to object-oriented programming standards. Furthermore, inheriting from the Web ADF WebControl will automatically package the Microsoft ASP.NET AJAX and Web ADF JavaScript Libraries with the control, making these available to client tier operations. 
&lt;P&gt;This is the approach we used when implementing the Web ADF controls, and we recently added &lt;A href="http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/concepts_start.htm#developer/ADF/developing_script_control.htm"&gt;a tutorial&lt;/A&gt; to the online help describing how to develop scriptable controls. The tutorial illustrates implementing a MapCoordinateDisplay control, which displays the current position of the mouse cursor over a buddied Map control.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/concepts_start.htm#developer/ADF/developing_script_control.htm"&gt;Tutorial discussion&lt;/A&gt;&lt;/B&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;B&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/concepts_start.htm#developer/ADF/developing_controls.htm"&gt;Best practices for web control development&lt;/A&gt;&lt;/B&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;B&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/samples_start.htm#developer/samples/Web_Applications/adftutorials/3bF6A00c-9Cc5-454f-9C83-D4FcD5671EC8.htm"&gt;Sample code (all tutorials)&lt;/A&gt;&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;I&gt;Contributed by the ArcGIS Server .NET software development team&lt;/I&gt;&lt;/P&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=3022" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term=".NET" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/.NET/default.aspx" /><category term="Help" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Help/default.aspx" /><category term="Performance" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Performance/default.aspx" /></entry><entry><title>Geoprocessing parameter types in the ArcGIS JavaScript API</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/11/12/Geoprocessing-parameter-types-in-the-ArcGIS-JavaScript-API.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/11/12/Geoprocessing-parameter-types-in-the-ArcGIS-JavaScript-API.aspx</id><published>2008-11-12T12:36:00Z</published><updated>2008-11-12T12:36:00Z</updated><content type="html">&lt;P&gt;Every geoprocessing task has a set of input parameters, which represent values or datasets that the model takes in. You need to supply the parameters correctly in order to run the task. In this post we'll look at how you find out the parameter types and supply them in your code when working with the ArcGIS JavaScript API.&lt;/P&gt;
&lt;P&gt;One important thing to remember about geoprocessing tasks is that they have &lt;A href="http://webhelp.esri.com/arcgisserver/9.3/dotNet/geoprocessing/input_a-611251936.htm"&gt;a limited set of input and output data types&lt;/A&gt; when compared with tools that you work with in ArcGIS Desktop. This makes it a little easier to work with parameters because you only have to learn a handful of object types.&lt;/P&gt;
&lt;P&gt;To find out the parameter data types for any geoprocessing task, use the Services Directory. For example, take a look at the &lt;A href="http://sampleserver2.arcgisonline.com/ArcGIS/rest/services/Portland/ESRI_CadastralData_Portland/GPServer/ClipAndShip"&gt;Services Directory page for this ClipAndShip task&lt;/A&gt;. There are two parameters here:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Area_To_Zip, which is of data type GPFeatureRecordSetLayer&lt;/LI&gt;
&lt;LI&gt;Email_Zip_To, which is of data type GPString&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;You can tell the above parameters are both inputs since their Direction is listed as "esriGPParameterDirectionInput".&lt;/P&gt;
&lt;P&gt;You may be wondering how you create those parameters in your JavaScript code, especially because there's no object in the API with a name resembling "GPFeatureRecordSetLayer". At this point you need to use the Parameter Type table in the &lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jshelp/intro_gp_parameters.htm"&gt;Supplying parameters for the Geoprocessor&lt;/A&gt; help topic to understand which JavaScript object corresponds to your parameter type. That table is copied in below:&lt;/P&gt;
&lt;TABLE class=""&gt;

&lt;TR&gt;
&lt;TD class=""&gt;&lt;B&gt;Parameter type&lt;/B&gt;&lt;/TD&gt;
&lt;TD class=""&gt;&lt;B&gt;Corresponding JavaScript object&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;GPBoolean&lt;/TD&gt;
&lt;TD class=""&gt;boolean&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;GPDataFile&lt;/TD&gt;
&lt;TD class=""&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jsapi/DataFile.htm"&gt;DataFile&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;GPDate&lt;/TD&gt;
&lt;TD class=""&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jsapi/Date.htm"&gt;Date&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;GPDouble&lt;/TD&gt;
&lt;TD class=""&gt;number&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;GPFeatureRecordSetLayer&lt;/TD&gt;
&lt;TD class=""&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jsapi/FeatureSet.htm"&gt;FeatureSet&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;GPLinearUnit&lt;/TD&gt;
&lt;TD class=""&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jsapi/LinearUnit.htm"&gt;LinearUnit&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;GPLong&lt;/TD&gt;
&lt;TD class=""&gt;number&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;GPRasterData&lt;/TD&gt;
&lt;TD class=""&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jsapi/RasterData.htm"&gt;RasterData&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;GPRasterLayer&lt;/TD&gt;
&lt;TD class=""&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jsapi/RasterData.htm"&gt;RasterData&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;GPRecordSet&lt;/TD&gt;
&lt;TD class=""&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jsapi/FeatureSet.htm"&gt;FeatureSet&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;GPString&lt;/TD&gt;
&lt;TD class=""&gt;string&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;
&lt;P&gt;This table shows that the corresponding JavaScript object for a GPFeatureRecordSetLayer is the &lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jsapi/FeatureSet.htm"&gt;FeatureSet&lt;/A&gt;. This is an array of graphic features that can contain geometry and/or attributes.&lt;/P&gt;
&lt;P&gt;For the GPString parameter, you just need to create a JavaScript string.&lt;/P&gt;
&lt;P&gt;Once you have all the input parameters, you need to list them in JavaScript Object Notation (JSON) and pass them to the &lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jsapi/Geoprocessor.htm"&gt;Geoprocessor&lt;/A&gt;. Your code might look like the following:&lt;/P&gt;&lt;PRE&gt;var params = { "Area_To_Zip":myFeatureSet, "Email_Zip_To":email };
gp.execute(params);&lt;/PRE&gt;
&lt;P&gt;If there are output parameters, you'll have access to a &lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jsapi/ParameterValue.htm"&gt;ParameterValue&lt;/A&gt; array after the job completes. The number and types of objects in the array will vary according to the number and types of output parameters used by the task. However, the mappings between parameter types and JavaScript objects will still follow the table above.&lt;/P&gt;
&lt;P&gt;To learn more about input and output parameters, see:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jshelp/intro_gp_running.htm"&gt;Running a geoprocessing task and getting the results&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;The &lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples/gp_servicearea.html"&gt;Geoprocessor Task Samples&lt;/A&gt; in the online SDK&lt;/LI&gt;
&lt;LI&gt;The "Geoprocessing Videos" in the topic &lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jshelp/intro_gp_overview.htm"&gt;An Overview of Geoprocessing with the ArcGIS JavaScript API&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;I&gt;Contributed by Sterling Quinn of the ArcGIS Server software development team&lt;/I&gt;&lt;/P&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2977" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term="Geoprocessing" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Geoprocessing/default.aspx" /><category term="JavaScript" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/JavaScript/default.aspx" /><category term="9.3" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/9.3/default.aspx" /></entry><entry><title>Customizing the map progress bar in the 9.3 Web ADF (.NET)</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/11/07/Customizing-the-map-progress-bar-in-the-9.3-Web-ADF-_28002E00_NET_2900_.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/11/07/Customizing-the-map-progress-bar-in-the-9.3-Web-ADF-_28002E00_NET_2900_.aspx</id><published>2008-11-07T17:25:00Z</published><updated>2008-11-07T17:25:00Z</updated><content type="html">&lt;p&gt;The Web ADF includes a progress bar that displays when the map is loading map images or tiles. It makes the user aware that the site is processing the user's request. You may wish to customize the progress bar, either to modify it or to replace it with your own progress indicator. An &lt;a href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2007/05/01/How-to-track-pending-tiles-and-display-a-busy-indicator-in-a-Web-mapping-application.aspx"&gt;earlier blog post&lt;/a&gt; described how to do this at the 9.2 version. Things have changed for the 9.3 version, and this post gives some tips on customizing the progress bar for 9.3.&lt;/p&gt;
&lt;p&gt;We will cover two options for customizing the progress indicator. First, you can set some of the properties of the existing progress bar. Second, you can completely replace the progress bar with your own custom progress indicator. The second option involves working with custom progress events, which we will discuss before we get to the actual replacement of the default progress indicator.&lt;/p&gt;
&lt;h3&gt;Setting progress bar properties&lt;/h3&gt;
&lt;p&gt;At the 9.3 release, two public properties are exposed that you can set for the standard progress bar. These properties are the alignment, or location, of the progress bar on the map; and whether to enable or disable the progress bar. More properties may be exposed at future service packs or versions. We will use the enable/disable property later in this article, when we replace the progress bar. Let us look now at setting the alignment property, which will introduce a client-side approach we will use throughout this article.&lt;/p&gt;
&lt;p&gt;The alignment property may be set using the Web ADF JavaScript Library. The Web ADF contains both code that runs on the server and code that runs on the client. The server-side code uses an ASP.NET language (C# or VB). The client-side code uses JavaScript, so we use that language to customize how the client code works. You can find documentation on the Web ADF JavaScript Library in the ArcGIS Server Developer Help, available either installed on your development computer, or &lt;a href="http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/concepts_start.htm" target="_blank"&gt;online at the ESRI Resource Center&lt;/a&gt;. See the topic &lt;b&gt;Web ADF JavaScript Library&lt;/b&gt; under the heading &lt;b&gt;Developing Web applications using the Web ADF&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;The progress bar properties are on the Map, since the bar is tied to the Map. Most of the properties and methods for the &lt;a href="http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/net_adfjs/html/T_J_ESRI_ADF_UI_Map.htm" target="_blank"&gt;Map class&lt;/a&gt; are actually on the &lt;a href="http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/net_adfjs/html/T_J_ESRI_ADF_UI_MapBase.htm" target="_blank"&gt;MapBase class&lt;/a&gt;, which the Map class extends. If you look on the class properties for MapBase, you will find the &lt;a href="http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/net_adfjs/html/P_J_ESRI_ADF_UI_MapBase_progressBarAlignment.htm" target="_blank"&gt;progressBarAlignment&lt;/a&gt; property. You will notice that, like most other properties, the documentation actually shows two methods associated with this property: get_progressBarAlignment() and set_progressBarAlignment(). As you will see in the code, we use these methods rather than the property per se when setting the propery.&lt;/p&gt;
&lt;p&gt;The set_progressBarAlignment() method takes one argument when you call it: a &lt;a href="http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/net_adfjs/html/T_J_ESRI_ADF_System_ContentAlignment.htm" target="_blank"&gt;ContentAlignment&lt;/a&gt; setting. For information on this enumeration, you can click on the ContentAlignment link on the progressBarAlignment page in the help, or find it under the ESRI.ADF.System namespace in the Web ADF JavaScript Library documentation. The ContentAlignment enumeration has nine values, corresponding to nine positions on the map. They include TopLeft, MiddleCenter, and BottomRight (the default).&lt;/p&gt;
&lt;p&gt;Now we have the information we need to set the progress bar's alignment. To demonstrate, we will set the progress bar alignment to the MiddleCenter of the map. To do this, we add some JavaScript code into the .aspx page for our application, typically the Default.aspx page. Near the bottom of the page, just before the closing &amp;lt;/body&amp;gt; tag, add a JavaScript function that will be called when the page starts up. We can do this using the ASP.NET AJAX &lt;a href="http://msdn.microsoft.com/en-us/library/bb397532.aspx" target="_blank"&gt;add_init&lt;/a&gt; function, which guarantees our function will run after the page completely loads. We pass to add_init the name of the function (setupProgressIndicator) that will be called on startup.&lt;/p&gt;
&lt;p&gt;In the setupProgressIndicator function, we get a reference to the JavaScript component for the map, using the ASP.NET AJAX &lt;a href="http://msdn.microsoft.com/en-us/library/bb397441.aspx" target="_blank"&gt;$find&lt;/a&gt; function. Then we set the progress bar alignment using the ContentAlignment value we want. The resulting code would go into your .aspx page, just before the closing &amp;lt;/body&amp;gt; tag.&lt;/p&gt;&lt;pre&gt;&amp;lt;script language="javascript" type="text/javascript"&amp;gt;&lt;br&gt;    &lt;br&gt;    // Have our custom function called when the user starts the application&lt;br&gt;    Sys.Application.add_init(setupProgressIndicator);&lt;br&gt;&lt;br&gt;    function setupProgressIndicator() {&lt;br&gt;    &lt;br&gt;        // Get the JavaScript map component&lt;br&gt;        var map = $find('Map1');&lt;br&gt;&lt;br&gt;        // Set the location of the progress bar&lt;br&gt;        map.set_progressBarAlignment(ESRI.ADF.System.ContentAlignment.MiddleCenter);&lt;br&gt;    }&lt;br&gt;    &lt;br&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;h3&gt;Custom progress events&lt;/h3&gt;
&lt;p&gt;If you want to do more than set the alignment of the built-in progress bar, you can have custom code that runs when the map is loading images or tiles. You can use this approach to supplement the standard progress bar, or completely replace it with your own indicator. The map's onProgress event enables us to run custom code. This and other map events are discussed in the Web ADF JavaScript Library section of the &lt;a href="http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/concepts_start.htm" target="_blank"&gt;Developer Help&lt;/a&gt;. In this section, we will use this event to display the number of pending tiles on the progress bar. Later we will replace the progress bar with a custom indicator.&lt;/p&gt;
&lt;p&gt;To show custom content when the map is loading images or tiles, we can use the &lt;a href="http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/net_adfjs/html/E_J_ESRI_ADF_UI_MapBase_onProgress.htm" target="_blank"&gt;onProgress&lt;/a&gt; event on the map client. This event is new at 9.3, and replaces multiple events that were used at 9.2 (onRequestsPending, etc.). When a function is attached to the onProgress event, it gets called each time the number of pending tiles changes. The custom function takes two arguments: the sender of the event, which is the map component; and the number of pending tiles. You can check the second argument to determine what to display to the user.&lt;/p&gt;
&lt;p&gt;In the code sample below, we attach to the onProgress event by calling the map's add_onProgress method. We pass it the function to be called when the number of pending tiles changes. In this function, showProgress, we examine the number of tiles as given in the args value. If the number is greater than zero, then we display the number of tiles in the browser's status bar. If the number of tiles is zero (i.e., the map is finished loading tiles), then we hide the status bar message.&lt;/p&gt;&lt;pre&gt;&amp;lt;script language="javascript" type="text/javascript"&amp;gt;&lt;br&gt;    &lt;br&gt;    Sys.Application.add_init(setupProgressIndicator);&lt;br&gt;&lt;br&gt;    function setupProgressIndicator() {&lt;br&gt;    &lt;br&gt;        // Get the JavaScript map component&lt;br&gt;        var map = $find('Map1');&lt;br&gt;&lt;br&gt;        // Set the location of the progress bar&lt;br&gt;        map.set_progressBarAlignment(ESRI.ADF.System.ContentAlignment.TopLeft);&lt;br&gt;        &lt;br&gt;        // Add the custom progress function&lt;br&gt;        map.add_onProgress(showProgress);&lt;br&gt;    }&lt;br&gt;    &lt;br&gt;    // Custom progress function&lt;br&gt;    //  sender = map component, args = number of pending tiles&lt;br&gt;    function showProgress(sender, args) {&lt;br&gt;    &lt;br&gt;        // If tiles pending, display number in status bar&lt;br&gt;        if (args &amp;gt; 0) {&lt;br&gt;            window.status = "Pending map tiles: " + args.toString();&lt;br&gt;        } else {&lt;br&gt;            // All tiles loaded - hide status bar message&lt;br&gt;            window.status = "";&lt;br&gt;        }&lt;br&gt;    }&lt;br&gt;    &lt;br&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;h3&gt;Custom progress indicator&lt;/h3&gt;
&lt;p&gt;Finally, we look at how to completely replace the existing progress bar with a custom indicator. The steps are: (1) turn the standard progress bar off; (2) create our custom progress indicator; and (3) turn on and off our custom indicator using the onProgress event described earlier.&lt;/p&gt;
&lt;p&gt;The best way to turn off the standard progress bar is to use the EnableProgressBar property on the ASP.NET Web control. You can set this in Visual Studio by switching the page to Design view, selecting the Map control, and setting EnableProgressBar to False in the Properties window. Or, you can scroll up in the Source view to the Map control and add the EnableProgressBar property there, like this:&lt;/p&gt;&lt;pre&gt;&amp;lt;esri:Map ID="Map1" runat="server" Height="423px"  &lt;br&gt;    MapResourceManager="MapResourceManager1" Width="554px"&lt;br&gt;    EnableProgressBar="False" &amp;gt;&lt;br&gt;&amp;lt;/esri:Map&amp;gt;&lt;/pre&gt;
&lt;p&gt;Second, we'll create our custom progress indicator. This indicator can be as simple or complex as you wish. An animated GIF image is common, but you could write a custom indicator similar to the built-in progress bar, which uses multiple divs and styles to create an animation. For our example, we will use the ajax-loader-circle.gif image, which is included with several samples in the Web ADF developer samples, such as ArcGIS_Spatial_Query_SOE. We copied this gif into our Web application folder and added it into the .aspx page within a div. We set the style position of the div so that it is approximately centered on the map control. Of course you could add code to dynamically position the progress indicator over the map, such as by getting the map's offsetLeft/offsetTop and setting the progress indicator's style position (see the zip file for the sample for an example of this).&lt;/p&gt;&lt;pre&gt;&amp;lt;div id="progressImageDiv" style="position:absolute;left:250px;top:320px;"&amp;gt;&lt;br&gt;    &amp;lt;img id="progressImg" src="ajax-loader-circle.gif" alt="Loading..." /&amp;gt;&lt;br&gt;&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;p&gt;Third, to show and hide our custom progress indicator, we use the same approach with the onProgress event as above. If tiles are pending (args &amp;gt; 0), then we show the progress indicator; otherwise we hide the indicator. To show/hide the indicator, we could add code to get the indicator div and set its style.display property. But the Web ADF has built-in functions to show or hide a div section, which we will use instead: showLayer and hideLayer. The complete code, with both the custom progress indicator and status bar text, is shown below.&lt;/p&gt;&lt;pre&gt;&amp;lt;div id="progressImageDiv" style="position:absolute;left:250px;top:320px;"&amp;gt;&lt;br&gt;    &amp;lt;img id="progressImg" src="ajax-loader-circle.gif" alt="Loading..." /&amp;gt;&lt;br&gt;&amp;lt;/div&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;script language="javascript" type="text/javascript"&amp;gt;&lt;br&gt;    &lt;br&gt;    Sys.Application.add_init(setupProgressIndicator);&lt;br&gt;&lt;br&gt;    function setupProgressIndicator() {&lt;br&gt;    &lt;br&gt;        // Get the JavaScript map component&lt;br&gt;        var map = $find('Map1');&lt;br&gt;&lt;br&gt;        // Add the custom progress function&lt;br&gt;        map.add_onProgress(showProgress);&lt;br&gt;    }&lt;br&gt;    &lt;br&gt;    // Custom progress function&lt;br&gt;    //  sender = map component, args = number of pending tiles&lt;br&gt;    function showProgress(sender, args) {&lt;br&gt;    &lt;br&gt;        var progressImageDiv = $get("progressImageDiv");&lt;br&gt;&lt;br&gt;        // If tiles pending, display progress indicator and tile number in status bar&lt;br&gt;        if (args &amp;gt; 0) {&lt;br&gt;            window.status = "Pending map tiles: " + args.toString();&lt;br&gt;            progressImageDiv.style.display = "block";&lt;br&gt;        } else {&lt;br&gt;            // All tiles loaded - hide progress indicator and status bar message&lt;br&gt;            window.status = "";&lt;br&gt;            progressImageDiv.style.display = "none";&lt;br&gt;        }&lt;br&gt;    }&lt;br&gt;    &lt;br&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;p&gt;The code produces something like this when the progress indicator is displaying:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2922/original.aspx" title="Customized progress bar" alt="Customized progress bar"&gt;&lt;/p&gt;
&lt;p&gt;The complete code for this sample is available in &lt;a href="http://serverapps.esri.com/BlogDownloads/2008/ProgressBar.zip"&gt;this zip file&lt;/a&gt;. The code includes a few enhancements to the code above, such as an option to recenter the custom progress indicator if the map is resized, which may occur with the Web Mapping Application template. You can also try out this sample with the link provided.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;We have seen how to customize the progress indicator for the map, both by setting properties of the standard progress bar and by adding our own custom event handling to display information or even a custom progress image. The map has other events and properties that you could use for performing custom handling on the client. See the Web ADF JavaScript Library reference in the Developer Help for further information. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://serverapps.esri.com/ProgressBar/CustomProgressBar.aspx" target="_blank"&gt;&lt;b&gt;Try the example application&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://serverapps.esri.com/BlogDownloads/2008/ProgressBar.zip"&gt;&lt;b&gt;Get the code&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Contributed by Bryan Baker of the ArcGIS Server .NET software development team.&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2934" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term=".NET" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/.NET/default.aspx" /><category term="JavaScript" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/JavaScript/default.aspx" /><category term="Web Mapping Application" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Web+Mapping+Application/default.aspx" /><category term="9.3" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/9.3/default.aspx" /></entry><entry><title>Creating a simple map dijit with the ArcGIS JavaScript API</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/11/03/Creating-a-simple-map-dijit-with-the-ArcGIS-JavaScript-API.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/11/03/Creating-a-simple-map-dijit-with-the-ArcGIS-JavaScript-API.aspx</id><published>2008-11-04T00:22:00Z</published><updated>2008-11-04T00:22:00Z</updated><content type="html">
&lt;p&gt;Dojo Widgets or dijits are a great way to build web application UI components that either combine other components or bind data with business logic. Dijits are designed to be easy for users embed within their web applications.&lt;/p&gt;

&lt;p&gt;In this post we’ll create a dijit that could allow a large city to share its mapping data with its citizens and allow businesses to integrate other functionality.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2908/original.aspx" title="Finished map dijit" style="width:471px;height:350px;" alt="Finished map dijit" width="471" height="350"&gt;&lt;/p&gt;
&lt;h3&gt;The Basics&lt;/h3&gt;
&lt;p&gt;When creating a dijit or a collection of dijits, it’s recommended that you use a specific folder structure. Each dijit requires a template, some cascading style sheets (CSS) and some images. Correspondingly, there are the &lt;i&gt;templates&lt;/i&gt;, &lt;i&gt;css&lt;/i&gt; and &lt;i&gt;images&lt;/i&gt; folders. It is up to you whether to create these folders for each dijit or share these among several dijits.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2909/original.aspx" title="Folder structure" style="width:531px;height:309px;" alt="Folder structure" width="531" height="309"&gt;&lt;/p&gt;
&lt;h3&gt;The Template&lt;/h3&gt;
&lt;p&gt;All dijits start off with a layout that puts together the visual components. This dijit will contain a &amp;lt;div&amp;gt; for the map, a &amp;lt;span&amp;gt; with 2 buttons for toggling data layers and finally an &amp;lt;img&amp;gt; with the city seal. Clicking on the image opens a new window and navigates to the city’s home page.&lt;/p&gt;

&lt;p&gt;You can optionally use CSS to style the visual components. In this case, since the toggle buttons and image are map overlays, we’ll apply CSS styling appropriately.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;templates/MyFirstMapDijit.html&lt;/b&gt;&lt;/p&gt;
&lt;pre&gt;&amp;lt;div class="mapdijit"&amp;gt;&lt;br&gt;  &amp;lt;span class="layerbuttons"&amp;gt;&lt;br&gt;    &amp;lt;button dojoType="dijit.form.ToggleButton" dojoAttachEvent="onXXX:callback" ID="Button1"&amp;gt;Neighborhoods&amp;lt;/button&amp;gt;&lt;br&gt;    &amp;lt;button ... checked ID="Button2"&amp;gt;Landbase&amp;lt;/button&amp;gt;&lt;br&gt;  &amp;lt;/span&amp;gt;&lt;br&gt;  &amp;lt;img src="..." class="seal" dojoattachevent="onclick:gotoCityOfPortland" /&amp;gt;&lt;br&gt;&amp;lt;/div&amp;gt;&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;It’s important to note the &lt;i&gt;dojoType&lt;/i&gt;, &lt;i&gt;dojoAttachEvent&lt;/i&gt;, and &lt;i&gt;dojoattacheevent&lt;/i&gt; attributes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You will need to specify the &lt;i&gt;dojoType attribute&lt;/i&gt; in order to allow the Dojo parser system to parse and apply rendering for appropriate dijits. This attribute value matches the name of a dijit class. 
&lt;/li&gt;
&lt;li&gt;The &lt;i&gt;dojoAttachEvent&lt;/i&gt; attribute connects a specific event onXXX on the dijit and calls the specified callback function. 
&lt;/li&gt;
&lt;li&gt;The &lt;i&gt;dojoattachevent&lt;/i&gt; attribute connects a specific event, say &lt;i&gt;onclick&lt;/i&gt; on the HTML element and calls the specified function &lt;i&gt;gotoCityOfPortland&lt;/i&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;The Stylesheet&lt;/h3&gt;
&lt;p&gt;A CSS file is used to style the look and feel of the dijit. A user can potentially change the CSS to change the look and feel of this dijit.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;css/MyFirstMapDijit.css&lt;/b&gt;&lt;/p&gt;
&lt;pre&gt;.mapdijit { position:relative; }&lt;br&gt;.mapdijit .layerbuttons { ...; z-index:100; ... }&lt;br&gt;.mapdijit .seal { ...; z-index:100; }&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;The CSS classes are referenced in the class attribute in the template markup. One thing to note is the z-index attribute on all map overlays. It is recommended that you use a z-index of 100 or higher when an element needs to display on top of a map.&lt;/p&gt;
&lt;h3&gt;The Dijit Class&lt;/h3&gt;
&lt;p&gt;Each dijit is backed by a JavaScript class which defines the behavior of the dijit. We’ll add the ability to add/toggle data layers and the additional behavior of opening the city's home page when a user clicks on the seal.&lt;/p&gt;

&lt;p&gt;As part of the lifecycle of the dijit, at the last step at startup, we will initialize the map once all the HTML elements have been laid down and presented to the client.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;MyFirstMapDijit.js&lt;/b&gt;&lt;/p&gt;
&lt;pre&gt;dojo.provide(...);&lt;br&gt;&lt;br&gt;//include all dijit dependecies&lt;br&gt;dojo.require(...);&lt;br&gt;&lt;br&gt;//declare new dijit class&lt;br&gt;dojo.declare("mydijits.MyFirstMapDijit", [dijit._Widget, dijit._Templated], {&lt;br&gt;    //dijit template contains other dijits&lt;br&gt;    widgetsInTemplate: true,&lt;br&gt;&lt;br&gt;    //path to template&lt;br&gt;    templatePath: ...,&lt;br&gt;&lt;br&gt;    //dijit startup method to initialize map&lt;br&gt;    startup: function() { ... },&lt;br&gt;&lt;br&gt;    //behavioral functions&lt;br&gt;    toggleLandbase: function(visibility) { ... },&lt;br&gt;    toggleNeighborhoods: function(visibility) { ... },&lt;br&gt;    _toggleLayer: function(layer, visibility) { ... },&lt;br&gt;    gotoCityOfPortland: function() { ... }&lt;br&gt;  }&lt;br&gt;);&lt;br&gt;&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;i&gt;toggle&lt;/i&gt;* and &lt;i&gt;gotoCityOfPortland&lt;/i&gt; functions provide the desired custom functionality. The &lt;i&gt;esri.Map&lt;/i&gt; is instantiated within the startup function. The &lt;i&gt;widgetsInTemplate&lt;/i&gt; property specifies that the template contains other dijits. The &lt;i&gt;templatePath&lt;/i&gt; specifies the path to the template file for the dijit. If the template is very simple, you can alternatively use the &lt;i&gt;templateString&lt;/i&gt; property and provide the markup in this string and not create a template file.&lt;/p&gt;

&lt;p&gt;Note: Specifying a template string reduces the number of server calls to fetch a template from a running application if a web page contains several different dijits.&lt;/p&gt;
&lt;h3&gt;Testing the Dijit&lt;/h3&gt;
&lt;p&gt;That's it! You are now ready to share this dijit with your users. To test it out, we’ll add the dijit to a blank page and verify that it works.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;MyFirstMapDijitTest.html&lt;/b&gt;&lt;/p&gt;
&lt;pre&gt; &lt;br&gt;  &amp;lt;head&amp;gt;&lt;br&gt;    ...&lt;br&gt;    &amp;lt;title&amp;gt;MyFirstMapDijit Test&amp;lt;/title&amp;gt; &lt;br&gt;    &amp;lt;!-- include dojo theme --&amp;gt;&lt;br&gt;    &amp;lt;link href=".../tundra.css"&amp;gt;&lt;br&gt;&lt;br&gt;    &amp;lt;!-- include dijit css --&amp;gt;&lt;br&gt;    &amp;lt;link href=".../MyFirstMapDijit.css"&amp;gt;&lt;br&gt;    &amp;lt;!-- specify dojo configuration --&amp;gt;&lt;br&gt;    &amp;lt;script ...&amp;gt;djConfig = { ... }&amp;lt;/script&amp;gt;&lt;br&gt;    &amp;lt;!-- reference ArcGIS JavaScript API --&amp;gt;&lt;br&gt;    &amp;lt;script ...&amp;gt;&amp;lt;/script&amp;gt;&lt;br&gt;&lt;br&gt;    &amp;lt;!-- reference newly created dijit --&amp;gt;&lt;br&gt;    &amp;lt;script ...&amp;gt;&amp;lt;/script&amp;gt;&lt;br&gt;&lt;br&gt;  &amp;lt;/head&amp;gt;&lt;br&gt;  &amp;lt;body class="tundra"&amp;gt;&lt;br&gt;    &amp;lt;!-- create markup --&amp;gt;&lt;br&gt;    &amp;lt;div dojoType="mydijits.MyFirstMapDijit" ...&amp;gt;&amp;lt;/div&amp;gt;&lt;br&gt;  &amp;lt;/body&amp;gt;&lt;br&gt;&lt;/pre&gt;
&lt;h3&gt;Wrapup&lt;/h3&gt;
&lt;p&gt;You’ve just put together your first mapping dijit using the ArcGIS JavaScript API. In subsequent posts, we’ll show how to add other dijits, that analyze data on the map and others which encapsulate data and behavior that you can easily add to a website.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://resources.esri.com/arcgisserver/apis/javascript/arcgis/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=15881"&gt;&lt;b&gt;Download the example from the Code Gallery&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://serverapps.esri.com/myfirstmapdijit/MyFirstMapDijitTest.html" target="_blank"&gt;&lt;b&gt;Try the live example&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Related links&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://resources.esri.com/arcgisserver/apis/javascript/arcgis/index.cfm?fa=home"&gt;ArcGIS JavaScript API&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://dojotoolkit.org/"&gt;Dojo&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/manipulating-widgets-through-code/writing-your"&gt;Dojo book: Writing Your Own Widget Class&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.onlamp.com/pub/a/onlamp/2007/11/01/the-mojo-of-dojo.html"&gt;The Mojo of Dojo (Creating Your Own Widgets)&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.sitepen.com/blog/2007/11/13/dissecting-dijit/"&gt;Dissecting Dijit&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;i&gt;Contributed by Jayant Sai of the ArcGIS JavaScript API development team.&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2912" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term="JavaScript" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/JavaScript/default.aspx" /><category term="Dojo" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Dojo/default.aspx" /><category term="dijits" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/dijits/default.aspx" /></entry><entry><title>Creating a DHTML scale bar with the .NET Web ADF</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/29/Creating-a-DHTML-scale-bar-with-the-.NET-Web-ADF.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/29/Creating-a-DHTML-scale-bar-with-the-.NET-Web-ADF.aspx</id><published>2008-10-29T16:20:00Z</published><updated>2008-10-29T16:20:00Z</updated><content type="html">&lt;P&gt;At the 9.3 release, the .Net Web ADF’s JavaScript library exposes a lot of logic to the client side, allowing you to create a more responsive UI without the need for making calls back to the server. You can get the &lt;A href="http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/developer/ADF/adfjavascript_overview.htm"&gt;Web ADF JavaScript library help&lt;/A&gt; on the ArcGIS Server Resource Center. This post will show you how to use the JavaScript library to create a pure client-side scale bar using the &lt;A href="http://msdn.microsoft.com/en-us/library/bb397536.aspx"&gt;Microsoft AJAX Client Library&lt;/A&gt; patterns.&lt;/P&gt;
&lt;P&gt;The Web ADF’s scale bar is generated by the primary map resource using a dynamically generated image. Since the scale potentially can change on every pan, the scale bar image has to be updated frequently, adding additional overhead to the server requests for rendering and fetching these images. Furthermore, if the primary map resource doesn’t support rendering a scale bar, no scale bar is available at all. ArcIMS ArcMap Services don’t support rendering a scale bar. The approach described in this post is the recommended pattern for displaying a scale bar for ArcIMS ArcMap Services.&lt;/P&gt;
&lt;P&gt;We can scale a standard &amp;lt;div&amp;gt; box dynamically on the client using JavaScript, and completely eliminate the extra callback, because the map control allows you to listen for and get the current extent of the map. We simply add a handler to the Map’s 'extentChanged' event. To do this, we first get a reference to the map object using the $find method parsing in the ClientID of the map as a parameter:&lt;/P&gt;&lt;PRE&gt;var map = $find('Map1');&lt;/PRE&gt;
&lt;P&gt;Next we add the handler which will be executed every time the extent of the map has changed:&lt;/P&gt;&lt;PRE&gt;map.add_extentChanged(myExtentChangedHandler);&lt;/PRE&gt;
&lt;P&gt;However, we need to ensure that this handler is not created until the Map has been instantiated on the client. The Microsoft AJAX framework also exposes several life-cycle events, for listening when the page has been fully loaded. So we wrap the above code in an application init event handler and place it right before the &amp;lt;/body&amp;gt; tag. Notice how the pattern for adding event handlers is similar to adding handlers to the map. The full example could look something like this:&lt;/P&gt;&lt;PRE&gt;&amp;lt;script type="text/javascript" language="javascript" &amp;gt;
	function myExtentChangedHandler(sender, args) {
		   alert(sender.get_id() + ' changed extent to: ' + args.current.toString());
	}
	Sys.Application.add_init(function() {
		   var map = $find('Map1');
		   map.add_extentChanged(myExtentChangedHandler);
	});
&amp;lt;/script&amp;gt;
&lt;/PRE&gt;
&lt;P&gt;Every time you pan the map, you will see a popup window like this:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Message that appears on pan" style="WIDTH:464px;HEIGHT:93px;" height=93 alt="Message that appears on pan" src="http://blogs.esri.com/Dev/photos/2008_server/images/2855/original.aspx" width=464&gt;&lt;/P&gt;
&lt;P&gt;This gives us the framework for creating a simple scale bar. The next step is to place a box on the page that we can use as a scale bar by changing the width as the pixel size changes.&lt;/P&gt;&lt;PRE&gt;&amp;lt;div&amp;gt;&amp;lt;div id="scalebar" style="background-color: #000000; width: 200px; height: 10px;"&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;span id="scalebarText"&amp;gt;100 units&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;

&amp;lt;script type="text/javascript" language="javascript" &amp;gt;

function resizeScalebar(sender, args) { //resize event handler
  var pixelSize = sender.get_pixelSize(); //Gets the size on one pixel in map units
  var scalebarWidthInMapUnits = 0.001; //The initial size of the scalebar in map units
  //width in pixels of a scalebar with the current 
  //scalebarWidthInMapUnits value and map's pixelsize
  var width = scalebarWidthInMapUnits / pixelSize;
  while(width&amp;lt;20) {
    //keep increasing scalebar size until we have a reasonable and visible size
    scalebarWidthInMapUnits *= 10;
    width = scalebarWidthInMapUnits / pixelSize;
  }
  $get('scalebar').style.width = width + 'px';
  $get('scalebarText').innerHTML = scalebarWidthInMapUnits + ' units';
}
//Hook up the handlers during init
Sys.Application.add_init(function() {
  var map = $find('Map1');
  map.add_extentChanged(resizeScalebar); //fired when extent has changed
  map.add_extentChanging(resizeScalebar); //fired while map is zooming/panning
  resizeScalebar(map,null); //Force initial update of scalebar
});

&amp;lt;/script&amp;gt;
&lt;/PRE&gt;
&lt;P&gt;This will generate a very simple scale bar that looks something like this:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Simple scale bar" style="WIDTH:107px;HEIGHT:16px;" height=16 alt="Simple scale bar" src="http://blogs.esri.com/Dev/photos/2008_server/images/2856/original.aspx" width=107&gt;&lt;/P&gt;
&lt;P&gt;It will automatically adjust its width between 20 and 200 px and show the corresponding width in map units next to it.&lt;/P&gt;
&lt;P&gt;The next step is to componentize this into a real client side control that can easily be reused. The Microsoft AJAX Client Library already has a framework in place for creating controls that can inherit from each other and be extended.&lt;/P&gt;
&lt;P&gt;A component requires a constructor, and a prototype. In the constructor you define the default properties of the control, and in the prototype you define the properties and methods, including initialize and dispose. Lastly you register the control and optionally the type you derive from, in this case &lt;A href="http://msdn.microsoft.com/en-us/library/bb310848.aspx"&gt;Sys.UI.Control&lt;/A&gt;.&lt;/P&gt;&lt;PRE&gt;Type.registerNamespace('ADF.Samples');

ADF.Samples.DhtmlScaleBar = function(element) {
  ADF.Samples.DhtmlScaleBar.initializeBase(this, [element]);
  this._map = null; //Reference to the map
  this._minWidth = 20; //minimum width of the bar before changing units
}
ADF.Samples.DhtmlScaleBar.prototype = {
  initialize : function () {
    ADF.Samples.DhtmlScaleBar.callBaseMethod(this, 'initialize'); //Call base initialize
    if(this._map === null) { throw Error.argumentNull('map'); }
    this._extentChangedHandler = Function.createDelegate(this,this._updateScalebar);
    //Add listener for when the map is animating its extent
    this._map.add_extentChanging(this._extentChangedHandler);
    //Add listener for when the map has changed its extent
    this._map.add_extentChanged(this._extentChangedHandler); 
    this._createBars(); // Creates the bar and text elements
    this._updateScalebar(this._map); //Update the scalebar now
  },
  dispose : function() {
    ADF.Samples.DhtmlScaleBar.callBaseMethod(this, 'dispose');
    if(this._extentChangedHandler &amp;amp;&amp;amp; this._map) { 
      this._map.remove_extentChanging(this._extentChangedHandler);
      this._map.remove_extentChanged(this._extentChangedHandler);
    }
    if(this._scaleBar) { this.get_element().removeNode(this._scaleBar);}
    if(this._scaleBarText) { this.get_element().removeNode(this._scaleBarText); }
    this._extentChangedHandler = null;
    this._map = null;
    this._scaleBar = null;
    this._scaleBarText = null;
  },
  _createBars : function() { //Create the bar and text
    this._scaleBar = document.createElement('div');
    this._scaleBar.style.backgroundColor = '#000000';
    this._scaleBar.style.float = 'left';
    this.get_element().appendChild(this._scaleBar);
    this._scaleBarText = document.createElement('span');
    this._scaleBarText.style.float = 'left';
    this.get_element().appendChild(this._scaleBarText);
  },
  _updateScalebar : function(sender,args) {
    var pixelSize = sender.get_pixelSize(); //Gets the size of one pixel in map units
    var scalebarWidthInMapUnits = 0.001; //The initial size of the scalebar in map units
    //width in pixels of a scalebar with the current
    //scalebarWidthInMapUnits value and map's pixelsize
    var width = scalebarWidthInMapUnits / pixelSize;
    while(width&amp;lt;this._minWidth) {
      //keep increasing scalebar size until we have a reasonable and visible size
      scalebarWidthInMapUnits *= 10;
      width = scalebarWidthInMapUnits / pixelSize;
    }
    this._scaleBar.style.width = width + 'px';
    this._scaleBarText.innerHTML = scalebarWidthInMapUnits + ' units';		
  },
  //Properties:
  get_map : function() { return this._map; },
  set_map : function(value) { this._map = value; },
  get_minWidth : function() { return this._minWidth; },
  set_minWidth : function(value) { this._minWidth = value; }
}
//Register class:
ADF.Samples.DhtmlScaleBar.registerClass('ADF.Samples.DhtmlScaleBar', Sys.UI.Control);

&lt;/PRE&gt;
&lt;P&gt;If we add this script to the page, we can now simply create a scale bar using the &lt;A href="http://msdn.microsoft.com/en-us/library/bb397487.aspx"&gt;$create&lt;/A&gt; method. The parameters are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Type&lt;/LI&gt;
&lt;LI&gt;Object list of properties&lt;/LI&gt;
&lt;LI&gt;Object list of event handlers (we don’t have any events here so we use null)&lt;/LI&gt;
&lt;LI&gt;Object list of component properties. In our case the map – this ensures that the scale bar is not initialized until the map has been initialized.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;&amp;lt;div id="bar"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;script type="text/javascript" language="javascript" &amp;gt;
Sys.Application.add_init(function() {
  $create(ADF.Samples.DhtmlScaleBar,{"minWidth":20},null,{"map":"Map1"},$get('bar'));
});
&amp;lt;/script&amp;gt;
&lt;/PRE&gt;
&lt;P&gt;At our code gallery you can download the scale bar control. It has been expanded to look a little better than just a black bar, and it also has a server-side web control that renders the above script to the page. It will analyze the primary map resource and fetch the unit of the map, and allow you to convert it to any display unit you would like on the fly. Finally, there's some extra logic which will get the scale bar to attempt to use some nice rounded intervals. The final result will look something like below, and will even resize while the zoom animation plays or while you pan toward the poles where the scale changes. You can style the control using the web control style properties like background color, border, font-size etc.&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Final scale bar" style="WIDTH:195px;HEIGHT:21px;" height=21 alt="Final scale bar" src="http://blogs.esri.com/Dev/photos/2008_server/images/2857/original.aspx" width=195&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://resources.esri.com/arcgisserver/adf/dotnet/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=15660"&gt;Click here to get the source code from the Code Gallery&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://serverapps.esri.com/DHTMLScaleBarWebSite/Default.aspx"&gt;Click here to view a demo of the scale bar&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;Contributed by Morten Nielsen of the ArcGIS Server .NET software development team&lt;/I&gt;&lt;/P&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2854" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term=".NET" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/.NET/default.aspx" /><category term="JavaScript" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/JavaScript/default.aspx" /><category term="9.3" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/9.3/default.aspx" /></entry><entry><title>The ArcGIS API for Flex 1.0 has been released</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/24/The-ArcGIS-API-for-Flex-1.0-has-been-released.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/24/The-ArcGIS-API-for-Flex-1.0-has-been-released.aspx</id><published>2008-10-24T23:09:00Z</published><updated>2008-10-24T23:09:00Z</updated><content type="html">&lt;P&gt;The &lt;A href="http://resources.esri.com/arcgisserver/apis/flex/index.cfm"&gt;ArcGIS API for Flex&lt;/A&gt; is a powerful framework for building rich internet applications (RIAs) on top of ArcGIS Server that look good, run fast and are fun to use. The Flex Resource Center includes help and samples for the API and is part of the &lt;A href="http://resources.esri.com/arcgisserver/"&gt;ArcGIS Server Resource Center&lt;/A&gt; web site. If you used our beta, take a look at &lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/flex/help/index.html#whats_new.htm#"&gt;What’s New&lt;/A&gt;.&lt;/P&gt;
&lt;H3&gt;What can you do with the ArcGIS API for Flex?&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;Display an interactive map of your own data.&lt;/LI&gt;
&lt;LI&gt;Execute a geoprocessing model on the server and display the results.&lt;/LI&gt;
&lt;LI&gt;Display your data on an ArcGIS Online basemap.&lt;/LI&gt;
&lt;LI&gt;Search for features or attributes in your GIS data and display the results.&lt;/LI&gt;
&lt;LI&gt;Locate addresses and display the results.&lt;/LI&gt;
&lt;LI&gt;Visualize results in creative ways.&lt;/LI&gt;
&lt;LI&gt;Create mashups.&lt;/LI&gt;&lt;/UL&gt;&lt;A title="Solar Boston map" href="http://gis.cityofboston.gov/solarboston/" target=_blank&gt;&lt;IMG title="Solar Boston application" alt="Solar Boston application" src="http://blogs.esri.com/Dev/photos/2008_server/images/2452/original.aspx"&gt;&lt;/A&gt; 
&lt;P&gt;&lt;I&gt;&lt;A href="http://gis.cityofboston.gov/solarboston/" target=_blank&gt;Solar Boston&lt;/A&gt; map is built with the ArcGIS API for Flex. It's an interactive mapping application that showcases active renewable energy installations in Boston.&lt;/I&gt;&lt;/P&gt;
&lt;H3&gt;What is included in the ArcGIS API for Flex?&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;Maps — Supports both dynamic and cached (tiled) map services from ArcGIS Server 9.3 and works with map projections. It also works with any version of ArcIMS. &lt;/LI&gt;
&lt;LI&gt;Graphics — Gain the ability to draw graphics or provide popup windows when users click or hover the mouse. &lt;/LI&gt;
&lt;LI&gt;Tasks — Support for common GIS tasks: querying, finding addresses, finding attributes, identifying features, and geoprocessing. &lt;/LI&gt;
&lt;LI&gt;Access to Flex components — The API is built on the Adobe Flex framework which allows you to use rich Flex components such as data grid, trees, panels and charts.&lt;/LI&gt;&lt;/UL&gt;
&lt;H3&gt;How do I learn how to use the ArcGIS API for Flex?&lt;/H3&gt;
&lt;P&gt;The best way to learn the API is to visit the &lt;A href="http://resources.esri.com/arcgisserver/apis/flex/index.cfm"&gt;ArcGIS API for Flex Resource Center&lt;/A&gt; and download . If you're new to Flex programming and ArcGIS Server, the &lt;B&gt;concepts&lt;/B&gt; will help you understand what Flex is and how to start working with it in ArcGIS. When you want to see more code, take a look at the live &lt;B&gt;samples&lt;/B&gt;. The samples cover a range of topics and provide a great starting point for your applications. A detailed &lt;B&gt;API reference&lt;/B&gt; describes each class available in the API. The &lt;B&gt;community&lt;/B&gt; page gives quick access to relevant forums, knowledge base articles, the ArcGIS Server blog, and a code gallery where user can share their applications. To use the Flex API you simply download the free &lt;A href="http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=downloadDisclaimer"&gt;ArcGIS API for Flex library&lt;/A&gt; and start creating your &lt;A href="http://www.adobe.com/products/flex/"&gt;Flex&lt;/A&gt; applications using Flex Builder 3 (or your Flex tool of choice).&lt;/P&gt;
&lt;H3&gt;What support is available?&lt;/H3&gt;
&lt;P&gt;In addition to the Resource Center, the user-to-user &lt;A href="http://forums.esri.com/forums.asp?c=158&amp;amp;s=2421#2421"&gt;forum&lt;/A&gt; is a great place for interacting with fellow Flex API developers, and also check out these &lt;A href="http://www.esri.com/getting_started/developers/support.html"&gt;additional ESRI resources&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;I&gt;Contribued by Bjorn Svensson of the ArcGIS API for Flex team.&lt;/I&gt;&lt;/P&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2858" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term="Flex" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Flex/default.aspx" /></entry><entry><title>Using Dojo dijits with the ArcGIS JavaScript API</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/22/Using-Dojo-dijits-with-the-ArcGIS-JavaScript-API.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/22/Using-Dojo-dijits-with-the-ArcGIS-JavaScript-API.aspx</id><published>2008-10-22T18:29:00Z</published><updated>2008-10-22T18:29:00Z</updated><content type="html">&lt;p&gt;A nice thing about the ArcGIS JavaScript API being built on top of the Dojo toolkit is that you can use Dojo widgets, or "dijits", to add prepackaged user interface components to your applications. Dojo has a bunch of existing dijits you can choose from such as text boxes, buttons, menus, calendars, color pickers, and so on. The online Book of Dojo has a nice &lt;a href="http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/dijit-glance"&gt;overview of the Dijit library&lt;/a&gt; that you can use to browse the dijits.&lt;/p&gt;

&lt;p&gt;Dijits have been tested to behave consistently in different browsers and comply with accessibility and localization requirements. The dijit framework is extensible, so with a little ambition you can even create your own dijits.&lt;/p&gt;

&lt;h3&gt;How would you use dijits in an ArcGIS JavaScript API application?&lt;/h3&gt;

&lt;p&gt;Your Web GIS applications may require the user to interact with the page outside of the map. For example, you might need users to enter some text, click a button, choose a value from a slider, or select an item from a dropdown list. Dijits give you a robust way to provide this functionality without writing the code yourself.&lt;/p&gt;&lt;p&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2846/original.aspx" title="Dijits for user input and results display" alt="Dijits for user input and results display" width="303" height="292"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;You can also combine several dijits into one for easy re-use. Suppose your company has multiple Web designers that want to embed maps in their pages. You can wrap up a map and some other elements inside a dijit, which the Web designers can then add to their pages without having to learn how to use the ArcGIS JavaScript API.&lt;/p&gt;

&lt;p&gt;In the image below, the map, slider, buttons, and city seal have been combined into a dijit that a Web designer could add to the page with a line of code. The slider and the buttons themselves are individual dijits included in the larger dijit.&lt;/p&gt;&lt;p&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2845/original.aspx" title="Custom map dijit made up of other dijits" alt="Custom map dijit made up of other dijits"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;Dijits can also help users accomplish focused workflows, such as finding nearby dentists, selecting a site for a business, or generating a route. In this way, dijits are similar to "tasks" in the Web ADF.&lt;/p&gt;&lt;p&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2847/original.aspx" title="Custom restaurant locator dijit" alt="Custom restaurant locator dijit"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;In the coming weeks we'll be posting more about how to create dijits that use the ArcGIS JavaScript API.&lt;/p&gt;

&lt;p&gt;&lt;i&gt;Contributed by Sterling Quinn of the ArcGIS Server software development team&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2840" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term="JavaScript" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/JavaScript/default.aspx" /><category term="Dojo" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Dojo/default.aspx" /><category term="dijits" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/dijits/default.aspx" /></entry><entry><title>Tips for choosing a cache image format</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/17/Tips-for-choosing-a-cache-image-format.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/17/Tips-for-choosing-a-cache-image-format.aspx</id><published>2008-10-17T21:48:00Z</published><updated>2008-10-17T21:48:00Z</updated><content type="html">&lt;p&gt;&lt;i&gt;We often receive questions about which image format is most appropriate for ArcGIS Server map 
			caches. In response we recently added the following information to the topic &lt;a href="http://webhelp.esri.com/arcgisserver/9.3/dotNet/choosing_cache_properties.htm"&gt;
				Choosing Cache Properties&lt;/a&gt; in the ArcGIS Server 9.3 Web Help.&lt;/i&gt;&lt;/p&gt;
		&lt;p&gt;Your choice of cache image format is important because it determines the size on disk 
			of the tiles, the image quality, and the ability to make the tile background 
			transparent.&lt;/p&gt;
		&lt;p&gt;Below is a summary of the available image formats and their appropriate uses.&lt;/p&gt;
		&lt;ul&gt;
			&lt;li&gt;
				&lt;b&gt;PNG8&lt;/b&gt; - Use this format for overlay services that need to have a 
				transparent background, such as roads and boundaries. PNG 8 creates tiles of 
				very small size on disk with no loss of information. However, you should use a 
				different PNG format if your map contains more than 256 colors. Imagery, 
				hillshades, gradient fills, transparency, and the antialiasing caching option 
				can easily push your map over 256 colors.&lt;/li&gt;
			&lt;li&gt;
				&lt;b&gt;PNG24&lt;/b&gt; - You can use this format for overlay services, such as roads and 
				boundaries, that have more than 256 colors (if fewer than 256 colors, use PNG 
				8). Do not use PNG 24 if your tiles will be viewed in Internet Explorer version 
				6 or previous.&lt;/li&gt;
			&lt;li&gt;
				&lt;b&gt;PNG32&lt;/b&gt; - Use this format for overlay services, such as roads and 
				boundaries, that have more than 256 colors. This format creates larger tiles 
				than PNG 24, but the tiles are fully supported in all browsers.&lt;/li&gt;
			&lt;li&gt;
				&lt;p&gt;
					&lt;b&gt;JPEG&lt;/b&gt; - Use this format for base map services that have large color 
					variation and do not need to have a transparent background. For example, raster 
					imagery tends to work well with JPEG.&lt;/p&gt;
				&lt;p&gt;JPEG is a lossy image format. It attempts to selectively remove data without 
					affecting the appearance of the image. This can cause very small tile sizes on 
					disk, but if your map contains vector linework or labels, it may produce too 
					much "noise" or blurry area around the lines. If this is the case, you can 
					attempt to raise the Compression value from the default of 75. A higher value 
					such as 90 may balance an acceptable quality of linework with the small tile 
					size benefit of the JPEG.&lt;/p&gt;
				&lt;p&gt;It's up to you to decide what image quality you consider acceptable. If you are 
					willing to accept a minor amount of noise in the images, you may save large 
					amounts of disk space by choosing JPEG. The smaller tile size also means the 
					browser can download the tiles faster.&lt;/p&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;p&gt;Before committing to an image format for a large cache, build a small cache of a 
			representative area of your map and examine the tile quality and performance in 
			a test application. If you'll be working with multiple caches, build a small 
			test cache for each and add them to a test application to make sure they 
			overlay as expected. This will allow you to make adjustments before you create 
			the entire cache.&lt;/p&gt;
		&lt;p&gt;To make a small test cache you can do any of the following:&lt;/p&gt;
		&lt;ul&gt;
			&lt;li&gt;
				Set a custom data frame extent to a small area in your source map document and 
				run Manage Map Server Cache Tiles.&lt;/li&gt;
			&lt;li&gt;
				Run Manage Map Server Cache Tiles and in the tool interface, edit the extent 
				rectangle to be a small area.&lt;/li&gt;
			&lt;li&gt;
				Use the editing tools in ArcMap to create a new feature class consisting of a 
				small rectangle around the area you want to test. Then select the option at the 
				bottom of the Manage Map Server Cache Tiles tool that allows you to create 
				tiles based on the boundary of a feature class.&lt;/li&gt;
		&lt;/ul&gt;
&lt;p&gt;&lt;i&gt;Contributed by Sterling Quinn of the ArcGIS Server software development team&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2799" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term="Map Cache" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Map+Cache/default.aspx" /></entry><entry><title>Live User Sites page shows applications built with ArcGIS Server</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/14/Live-User-Sites-page-shows-applications-built-with-ArcGIS-Server.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/14/Live-User-Sites-page-shows-applications-built-with-ArcGIS-Server.aspx</id><published>2008-10-14T18:13:00Z</published><updated>2008-10-14T18:13:00Z</updated><content type="html">&lt;P&gt;We often blog about the bits and pieces of what you can do with ArcGIS Server, but it’s really inspiring to see some finished applications that put it all together. ESRI’s new &lt;A href="http://www.esri.com/software/arcgis/arcgisserver/live_user_sites.html"&gt;Live User Sites&lt;/A&gt; page is a gallery of public-facing ArcGIS Server applications that you can browse and try out. Leave comments here on your favorite ones!&lt;/P&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2787" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term="Web Mapping Application" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Web+Mapping+Application/default.aspx" /></entry><entry><title>Using Gears in a .NET Web ADF application</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/10/Using-Gears-in-a-.NET-Web-ADF-application.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/10/Using-Gears-in-a-.NET-Web-ADF-application.aspx</id><published>2008-10-10T19:28:00Z</published><updated>2008-10-10T19:28:00Z</updated><content type="html">&lt;P&gt;&lt;A href="http://www.w3.org/html/wg/html5"&gt;HTML 5&lt;/A&gt; introduces offline storage support which allows the browser to serve up web pages and other data locally without having to access the Internet. Some newer browser versions (Safari 3.1/Firefox 3) offer built-in support for offline storage while other browsers can use &lt;A href="http://gears.google.com/"&gt;Gears&lt;/A&gt; to enable local storage and access of code and data without Internet access. Originally released by Google, Gears is an open-source browser plug-in that supports Internet Explorer, Firefox and Safari. A growing number of online service providers offer web applications that leverage Gears to support offline functionality using a local data store, The list of providers and applications includes &lt;A href="http://docs.google.com/"&gt;Google Docs&lt;/A&gt;, &lt;A href="http://www.google.com/reader"&gt;Google Reader&lt;/A&gt;, &lt;A href="http://www.zoho.com/"&gt;Zoho&lt;/A&gt;, &lt;A href="http://www.rememberthemilk.com/"&gt;Remember The Milk&lt;/A&gt;, and others.&lt;/P&gt;
&lt;P&gt;In a web mapping application, leveraging offline storage may enable you to improve application performance. In almost every case, utilizing a local client data store is faster than retrieving data from a remote server. There are, however, limitations and synchronization issues which we'll highlight later in this post.&lt;/P&gt;
&lt;P&gt;The 9.3 .Net Web ADF JavaScript Library provides an extensibility point for leveraging offline storage capabilities with components such as the Map control.&lt;/P&gt;
&lt;P&gt;The content of a basic web application can be categorized into two distinct areas:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Application Framework – includes the web page hosting the controls, client side code (JavaScript runtime) and supporting media such as images and style sheets&lt;/LI&gt;
&lt;LI&gt;Data – information passed to and from the server and the client. This includes image tiles from a cached map service that are stored on the client.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;In order to use an application offline, both the framework and relevant data need to be cached and available on the client.&lt;/P&gt;
&lt;P&gt;The remainder of this post presents an overview of the steps involved in leveraging offline capabilities with a web application that contains Web ADF controls and accesses ArcGIS Server cached services. There are two important points to consider before proceeding:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The web application needs a programmatic framework on the client to utilize offline storage. The &lt;A href="http://dojotoolkit.org/"&gt;Dojo Toolkit&lt;/A&gt; library offers a nice abstraction layer for browsers which do and do not have built-in support for offline storage. For example, when you access a web application in Firefox 3 the toolkit will use the native storage capabilities of the browser. However, if you access the same web application using Firefox 2 the toolkit will use the Gears plug-in (if installed) or degrade gracefully.&lt;/LI&gt;
&lt;LI&gt;Offline access to data is limited. For example, only data provided by the host server (e.g. URL from the same source as the application) can be cached locally. In the context of a web mapping application, you would be unable to cache a local copy of image tiles from a remote cached map service, such as ArcGIS Online. In order to work around this limitation you can use a server proxy. This workaround is discussed below.&lt;/LI&gt;&lt;/OL&gt;
&lt;H4&gt;Steps&lt;/H4&gt;
&lt;P&gt;Use the following steps to leverage offline storage with Web ADF controls and ArcGIS Server map services:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Add a Map and a MapResourceManager control to the web page. Add one or more cached map service resources. Optionally add buddy controls such as the ZoomLevel, Navigation, Toolbar to the web page.&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Add the Dojo Toolkit script library to your website and add a script reference to dojo.js in your web page.&lt;/P&gt;&lt;PRE&gt;&amp;lt;script type="text/javascript" src="javascript/dojotoolkit/dojo/dojo.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/PRE&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;The Web ADF JavaScript Library defines a set of layer types which can be used to access map images. One such layer type is AdfTileDirectAccess which enables the client browser to access pre-generated, cached map tiles via a URL. Use client-side JavaScript to override the getTileUrl method on the AdfTileDirectAccess component, to change how it accesses cached map tiles. Add the following script block at the bottom of the page, after the closing form tag (&amp;lt;/form&amp;gt;):&lt;/P&gt;&lt;PRE&gt;function getTileUrlAndCacheLocally (column,row,level,handler) {            &lt;BR&gt;      var func = this.get_tileUrlGeneratorFunction();&lt;BR&gt;      var serverUrl = this.get_serverUrl();    &lt;BR&gt;      var url = func(level, column, row, serverUrl);            &lt;BR&gt;      try {                &lt;BR&gt;             dojox.off.files.cache(url);&lt;BR&gt;             dojox.off.sync.synchronize();            &lt;BR&gt;             handler(url);&lt;BR&gt;       }&lt;BR&gt;       catch(e){handler(url);}    &lt;BR&gt;}; &lt;BR&gt;ESRI.ADF.Layers.AdfTileDirectAccess.prototype.getTileUrl = getTileUrlAndCacheLocally;&lt;BR&gt;&lt;/PRE&gt;
&lt;P&gt;In a nutshell, the above code intercepts a call to a function that generates a URL to a map image tile, caches the resource locally using the Dojo Toolkit’s offline API, then delegates to the handler.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Capture all files of the Application Framework into local storage when the application loads. To achieve this, define a list of necessary files and add all scripts and images on the page to the list. Then use the Dojo Toolkit to store these files for offline access.&lt;/P&gt;&lt;PRE&gt;var filesToCapture = [ location.pathname,   'images/backward_disabled.png', 'images/forward_disabled.png' ];&lt;BR&gt;&lt;BR&gt;var scripts = document.getElementsByTagName("script");&lt;BR&gt;for(var i=0; i &amp;lt; scripts.length; i++) {        &lt;BR&gt;     if(scripts[i].src.length &amp;gt; 0 &amp;amp;&amp;amp; scripts[i].src != '//:') {&lt;BR&gt;           Array.add(filesToCapture, scripts[i].src);&lt;BR&gt;     }&lt;BR&gt;}&lt;BR&gt;var images = document.getElementsByTagName("img");&lt;BR&gt;for(var j=0; j &amp;lt; images.length; j++) {&lt;BR&gt;     Array.add(filesToCapture, images[j].src);&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;dojox.off.files.slurp();&lt;BR&gt;dojo.forEach(filesToCapture, function(item) {   &lt;BR&gt;      dojox.off.files.cache(item);&lt;BR&gt;      dojox.off.sync.synchronize();&lt;BR&gt;});&lt;BR&gt;&lt;/PRE&gt;
&lt;P&gt;Note: Since the Dojo Toolkit uses a dynamic loader for downloading scripts on demand, scripts that may be loaded while using the web application will need to be cached locally as well. This can be achieved by adding the known paths/URL to the filesToCapture variable.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Thus far the JavaScript customizations to client-side code present an offline solution that works for caching resources (data, scripts, etc.) from the same originating server. If map image tiles reside on a remote server, a server proxy should be used. As the name suggests, the purpose of the server proxy (tileserverproxy.ashx) is to intercept requests to remote servers from the client, change the request to the same server on which the web application resides, and return map tile content.&lt;/P&gt;
&lt;P&gt;The handler would receive a set of input request parameters (server URL, tile level, column and row) and then forms a URL for the map tile based on ArcGIS Server tiling conventions. It then issues a web request for the tile and streams it back to the browser.&lt;/P&gt;
&lt;P&gt;A set of changes are also required in JavaScript on the client. A check is made to see if the tile URL being requested is from the originating server or not. If the URL is from a different server, the request is passed to the tileserverproxy instead. In essence, this changes how the getTileUrl method operates on an AdfTileDirectAccess component.&lt;/P&gt;&lt;PRE&gt;if(isSameOrigin(serverUrl)) {&lt;BR&gt;        url = func(level, column, row, serverUrl, imgFormat);        &lt;BR&gt;}&lt;BR&gt;else {&lt;BR&gt;        url = getServerProxyUrl(level, column, row, imgFormat, serverUrl);         &lt;BR&gt;}&lt;BR&gt;&lt;/PRE&gt;
&lt;H4&gt;Example&lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;&lt;A href="http://serverapps.esri.com/GearsWebSite/default.aspx" target=_blank&gt;View a demo application&lt;/A&gt;&lt;/B&gt; (&lt;B&gt;Note: &lt;/B&gt;In this demo, the cache is not available at the lowest zoom level.)&lt;/LI&gt;
&lt;LI&gt;&lt;B&gt;&lt;A href="http://resources.esri.com/arcgisserver/adf/dotnet/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=15850" target=_blank&gt;Download the application from the Code Gallery&lt;/A&gt;&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;After connecting to the website and browsing some tiles by navigating the map (zoom/pan), set your browser to work offline. In Internet Explorer or Firefox, you do this by navigating to File &amp;gt; Work Offline. (Note that if you disconnect from the network, you must still explicitly set your browser to work offline.) Now try accessing the same web page. You will notice a fully functioning page and you'll be able to navigate to tiles that are already present in your local cache.&lt;/P&gt;
&lt;H4&gt;Limitations&lt;/H4&gt;
&lt;P&gt;Any time there are multiple copies of data, synchronization issues will exist. In this case, the client machine has a local copy of the application and map tiles. This makes pushing updates to the client more difficult since the browser works with its local copy and does not query the online site for updates. If the application or map tiles do not change often, this may not pose a problem. However, if you regularly update the application functionality or map tiles, you will likely need to devise an update solution.&lt;/P&gt;
&lt;P&gt;Some options include:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Periodic polling to check for updates.&lt;/LI&gt;
&lt;LI&gt;Notify the client to clear the cache when updates are available.&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Add UI elements to explicitly clear the local cache&lt;/P&gt;&lt;PRE&gt;dojox.off.files.remove(url);&lt;/PRE&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;I&gt;Contributed by Nikhil Shampur of the ArcGIS Server .Net software development team&lt;/I&gt;&lt;/P&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2770" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term=".NET" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/.NET/default.aspx" /><category term="Code Snippet" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Code+Snippet/default.aspx" /><category term="9.3" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/9.3/default.aspx" /><category term="Dojo" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Dojo/default.aspx" /></entry><entry><title>Creating an ArcGIS Server Java custom security store</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/08/Creating-an-ArcGIS-Server-Java-custom-security-store.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/08/Creating-an-ArcGIS-Server-Java-custom-security-store.aspx</id><published>2008-10-08T16:44:00Z</published><updated>2008-10-08T16:44:00Z</updated><content type="html">	
&lt;p&gt;ArcGIS Server at 9.3 introduces Role Based Access Control (RBAC) to secure 
			capabilities published by the GIS Server. ArcGIS Server comes with a default 
			embedded database system to maintain all user and role information. ArcGIS 
			Server for Java provides the ability to customize the security system to manage 
			user and roles that exist in other Relational Databases or Directory Services 
			(LDAP or Active Directory) as well as an API to extend the security system. 
			Extending the system through the Principle Store API allows you to build a 
			custom Java class which reads and writes security parameters to and from a 
			custom data store. In this example we will create a Java class which reads and 
			writes users and roles to and from an XML file, from which your ArcGIS security 
			mechanism will consume the user and role information. There are four steps 
			involved in this process which we will step you through.&lt;/p&gt;
		
&lt;ol&gt;
			
&lt;li&gt;
				
&lt;p&gt;Create a custom security store class which implements &lt;i&gt;SecurityStore&lt;/i&gt;. The &lt;i&gt;SecurityStore&lt;/i&gt;
					interface is located in the &lt;i&gt;com.esri.adf.security.store&lt;/i&gt; package inside 
					the arcgis_securityapi.jar file. It includes methods to work with users and 
					roles in your custom RBAC as well as the ability to test your connection to the 
					data store. We will use the Eclipse developer environment to stub out our class 
					with the appropriate methods. From within Eclipse, create a package called &lt;i&gt;demo&lt;/i&gt;.&lt;br&gt;&lt;br&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2723/original.aspx" title="Demo package" alt="Demo package" width="132" height="136"&gt;&lt;br&gt;&lt;/p&gt;
				
&lt;p&gt;Inside the &lt;i&gt;demo&lt;/i&gt; package, create a class called &lt;i&gt;FileStore&lt;/i&gt; which 
					inherits the interface &lt;i&gt;com.esri.adf.security.store.SecurityStore&lt;/i&gt;. Be 
					sure the 'Inherited abstract methods' box is checked.&lt;br&gt;&lt;br&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2724/original.aspx" title="New class FileStore" alt="New class FileStore" width="398" height="481"&gt;&lt;br&gt;&lt;/p&gt;
				
&lt;p&gt;This will stub out the appropriate methods for our new class of which we can 
					implement to support our custom security store. Let's discuss some of the 
					methods that we implemented in the full source included in the &lt;a href="http://resources.esri.com/arcgisserver/adf/java/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=15822"&gt;
						Code Gallery&lt;/a&gt;.&lt;/p&gt;
				
&lt;p&gt;&lt;i&gt;init()&lt;/i&gt;: The &lt;i&gt;init&lt;/i&gt; method initializes the &lt;i&gt;SecurityStore&lt;/i&gt; implementation. 
					This is where we work with the file store by first checking to see if the file 
					exists, creating it if it does not, and then getting any users and roles which 
					already exist.
				&lt;/p&gt;
				
&lt;p&gt;&lt;i&gt;addUser(), deleteUser(), modifyUser(), getUser(), getAllUsers()&lt;/i&gt;: These 
					methods take in an &lt;i&gt;ArcGISSecurityUser&lt;/i&gt; class parameter and allows us to 
					manipulate these users within the security store.&lt;/p&gt;
				
&lt;p&gt;&lt;i&gt;addRole() addUsersToRoll(), deleteRole(), deleteAllRolesForUsers(), 
						deleteAllUsersForRolls(), deleteRolesFromUser(), deleteUsersFromRole(), 
						modifyRole(), getRole(), getAllRolls(), getRolesForUser(), getUsersForRole()&lt;/i&gt;: 
					These methods allow us to manipulate the roles, and users assigned to specific 
					roles, within our security store.&lt;/p&gt;
				
&lt;p&gt;&lt;i&gt;validateUser()&lt;/i&gt;: Here we can check the users credentials from the security 
					store. The method returns a Boolean value of true when the user credentials 
					match the information in the security store.&lt;/p&gt;
				
&lt;p&gt;We also created two helper methods:&lt;/p&gt;
				
&lt;p&gt;&lt;i&gt;createFileStore()&lt;/i&gt;: This method gets called in the init method if the file 
					store does not exist. It will then create the initial file store as an xml file 
					and create the required elements.&lt;/p&gt;
				
&lt;p&gt;&lt;i&gt;updateFileStore()&lt;/i&gt;: This methods gets called from within our add/delete 
					user/role methods we inherited and allows us to write a document memory object 
					back to our file store.&lt;/p&gt;
				
&lt;p&gt;Please implement the full source code from the &lt;a href="http://resources.esri.com/arcgisserver/adf/java/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=15822"&gt;
						FileStore.java&lt;/a&gt; class provided in the ArcGIS code gallery.&lt;/p&gt;
			&lt;/li&gt;
&lt;li&gt;
				
&lt;p&gt;Create a custom security.xml file to configure the custom &lt;i&gt;SecurityStore&lt;/i&gt; implementation 
					we created in step 1. This file is located in the 
					‘%ARCGISHOME%\java\manager\service\lib’ folder and by default contains the 
					information for the internal data store.&lt;/p&gt;
				
&lt;p&gt;To use our custom implementation, we need to replace the required connection
					
					parameter and add a user defined parameter &amp;lt;FS_FilePath&amp;gt; which points to 
					the file based XML file we are using to store our data store:&lt;/p&gt;
				
&lt;pre&gt;&amp;lt;entry key="UserStore"&amp;gt;demo.FileStore&amp;lt;/entry&amp;gt;		 &lt;br&gt;&amp;lt;entry key="FS_FilePath"&amp;gt;filestore.xml&amp;lt;/entry&amp;gt;&lt;br&gt;&lt;/pre&gt;
				
&lt;p&gt;We have included a simplified &lt;a href="http://resources.esri.com/arcgisserver/adf/java/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=15822"&gt;
						security.xml&lt;/a&gt; file in the ArcGIS code gallery which assumes security has 
					not already been configured and enabled on your GIS server.&lt;/p&gt;
			&lt;/li&gt;
&lt;li&gt;
				
&lt;p&gt;Create a jar file with our custom &lt;i&gt;SecurityStore&lt;/i&gt; implementation and hot 
					deploy it to the ‘%ARCGISHOME%\java\manager\config\security\lib’ directory. 
					This is easy to do from within Eclipse. (Alternatively you can create a jar 
					from the command line with the &lt;a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/jar.html"&gt;
						Java jar tool&lt;/a&gt;.) Return back to our class in Eclipse, right click on the 
					class file, and select 'Export' from the menu:&lt;br&gt;&lt;br&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2725/original.aspx" title="Export option on the context menu" alt="Export option on the context menu" width="312" height="529"&gt;&lt;br&gt;&lt;/p&gt;
				
&lt;p&gt;Select Java-&amp;gt;Jar file from the Export wizard:&lt;br&gt;&lt;br&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2726/original.aspx" title="Export wizard" alt="Export wizard" width="377" height="441"&gt;&lt;br&gt;&lt;/p&gt;
				
&lt;p&gt;Ensure that only the classes you want to export are selected, in this example 
					the &lt;i&gt;demo.FileStore&lt;/i&gt; class:&lt;br&gt;&lt;br&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2727/original.aspx" title="Defining resources for export" alt="Defining resources for export" width="445" height="475"&gt;&lt;br&gt;&lt;/p&gt;
				
&lt;p&gt;Select an appropriate export destination and click Finish to accept the 
					remaining defaults and generate a jar file for deployment. Copy the resulting 
					jar file containing the custom &lt;i&gt;SecurityStore&lt;/i&gt; implementation to the 
					‘%ARCGISHOME%\java\manager\config\security\lib’ directory.&lt;/p&gt;
			&lt;/li&gt;
&lt;li&gt;
				Once our custom &lt;i&gt;SecurityStore&lt;/i&gt; implementation jar file is in place and 
				our security.xml file is properly configured, we are ready to begin using our 
				custom security implementation. To reload the security configuration used in 
				our custom SecurityStore implementation, restart the ArcGIS Server Manager 
				Service.&lt;/li&gt;
		&lt;/ol&gt;
		
&lt;p&gt;Now let’s test our custom security configuration through Manager. ArcGIS Server 
			9.3 includes a new ‘Security’ menu where we can configure and setup our custom 
			Principle Store to manage users and roles. The ‘Roles link, under the 
			‘Security’ menu, lists all the Web GIS Roles currently configured on the 
			system. To add a new role, click the ‘Add Role’ button, fill in the ‘Rolename’, 
			and optionally a ‘Description’ for the new role:&lt;br&gt;&lt;br&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2728/original.aspx" title="Adding a role in Manager" alt="Adding a role in Manager" width="516" height="384"&gt;&lt;br&gt;&lt;/p&gt;
		
&lt;p&gt;Now that we have a role defined, let’s add a new user by clicking the ‘Users’ 
			link under the ‘Security’ menu. To add a new Web GIS User, click the ‘Add User’ 
			button and fill in the required fields and add the newly created ‘Editor’ role 
			defined in the previous step.&lt;br&gt;&lt;br&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2729/original.aspx" title="Adding a user in Manager" alt="Adding a user in Manager" width="528" height="449"&gt;&lt;br&gt;&lt;/p&gt;
		
&lt;p&gt;Now let’s take a look at the XML data store that our custom Security Store uses 
			to maintain users and roles to confirm that our custom implementation is 
			working as expected. Navigate your operating systems file browser to the 
			‘%ARCGISHOME%\java\manager\service\lib’ directory and open the newly created 
			filestore.xml in your favorite text/xml editor. The contents should look 
			similar to the following:&lt;/p&gt;
		
&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br&gt;&amp;lt;FileStore&amp;gt;&lt;br&gt;     &amp;lt;users&amp;gt;&lt;br&gt;          &amp;lt;user name="spatial" password="cdb36c370b737074c455bf1ee75a2f56"/&amp;gt;&lt;br&gt;     &amp;lt;/users&amp;gt;&lt;br&gt;     &amp;lt;roles&amp;gt;&lt;br&gt;          &amp;lt;role description="Allows write access" name="Editor"/&amp;gt;&lt;br&gt;     &amp;lt;/roles&amp;gt;&lt;br&gt;     &amp;lt;user_role&amp;gt;&lt;br&gt;          &amp;lt;spatial&amp;gt;Editor&amp;lt;/spatial&amp;gt;&lt;br&gt;     &amp;lt;/user_role&amp;gt;&lt;br&gt;&amp;lt;/FileStore&amp;gt;&lt;br&gt;&lt;/pre&gt;
		
&lt;p&gt;This file will now manage your users and roles as you continue to configure them 
			through Manager.&lt;/p&gt;
		&lt;h4&gt;Download&lt;/h4&gt;
		
&lt;p&gt;&lt;a href="http://resources.esri.com/arcgisserver/adf/java/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=15822"&gt;Sample 
				Custom Security Store source code for this article&lt;/a&gt;&lt;/p&gt;
		&lt;h4&gt;Resources&lt;/h4&gt;
		
&lt;p&gt;&lt;a href="http://webhelp.esri.com/arcgisserver/9.3/java/index.htm#extend_principal_store_api.htm"&gt;Extending 
				the Principal Store API&lt;/a&gt;&lt;/p&gt;
		
&lt;p&gt;&lt;a href="http://resources.esri.com/help/9.3/arcgisserver/adf/java/help/api/security"&gt;Security 
				API documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;i&gt;Contributed by Dan O'Neill of the ArcGIS Server Java software development team&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2730" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term="Java" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Java/default.aspx" /><category term="Security" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Security/default.aspx" /><category term="Administration" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Administration/default.aspx" /><category term="9.3" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/9.3/default.aspx" /></entry><entry><title>Working with custom renderers in the .NET Web ADF</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/03/Working-with-custom-renderers-in-the-.NET-Web-ADF.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/03/Working-with-custom-renderers-in-the-.NET-Web-ADF.aspx</id><published>2008-10-03T17:28:00Z</published><updated>2008-10-03T17:28:00Z</updated><content type="html">&lt;p&gt;&lt;a href="http://serverapps.esri.com/CustomRenderers/Washington.aspx" title="Custom renderers example" target="_blank"&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2743/original.aspx" title="Custom 2.5D renderer for Washington DC" style="width:344px;height:298px;" alt="Custom 2.5D renderer for Washington DC" align="right" height="298" hspace="10" width="344"&gt;&lt;/a&gt;The Web ADF allows you to go beyond the default symbols for graphics layers by creating custom renderers. This post will show how to create custom renderers and apply them to FeatureGraphicsLayers using the IRenderer interface. The IRenderer interface allows you to take full control of how a specific feature is rendered on the map by using .NET’s System.Drawing classes.&lt;/p&gt;
&lt;p&gt;The IRenderer interface consists of five methods, but if you can do without support for the Table of Contents (TOC) control, only one of them is really needed, and you can use some very simple implementations of the remaining four methods.&lt;/p&gt;
&lt;p&gt;The five methods are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;GenerateSwatches - Generates swatches for this renderer for display in a table of contents &lt;/li&gt;
&lt;li&gt;GetAllSymbols - Returns all FeatureSymbols used by this object, if any &lt;/li&gt;
&lt;li&gt;GetMaxSwatchDimensions - Gets the maximum dimensions of the swatches generated by this renderer &lt;/li&gt;
&lt;li&gt;Clone – Returns a clone of this renderer &lt;/li&gt;
&lt;li&gt;Render - Draws the specified geometry to the specified graphics&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;For the simplest renderer, the following is sufficient for the first four methods:&lt;/p&gt;&lt;pre&gt;public SwatchCollection GenerateSwatches(SwatchInfo swatchInfo, string fileName, string minScale, string maxScale)&lt;br&gt;{&lt;br&gt;	return new SwatchCollection();&lt;br&gt;}&lt;br&gt;public void GetAllSymbols(List&amp;lt; FeatureSymbol&amp;gt; symbols) { }&lt;br&gt;public void GetMaxSwatchDimensions(ref int width, ref int height) { }&lt;br&gt;public object Clone() { return this.MemberwiseClone(); }&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;This implementation will not support swatches, but we will later get back to how to also support this.&lt;/p&gt;
&lt;p&gt;The main method we need to look at is "Render". As input you get three parameters: The row with attributes you are rendering, a reference to the graphics instance that you should render to, and the name of the column in the datarow that contains the geometry data. The geometry data that is parsed in here is not in map units, but has already been converted to screen coordinates, so you don’t have to worry about translating your feature to the screen.&lt;/p&gt;
&lt;p&gt;So the very first thing we do in our renderer is to fetch the geometry that we want to render. In most cases the first few lines of a renderer will look something like this:&lt;/p&gt;&lt;pre&gt;public override void Render(DataRow row, Graphics graphics, DataColumn geometryColumn)&lt;br&gt;{&lt;br&gt;  if (row == null || graphics == null || geometryColumn == null)&lt;br&gt;    return;&lt;br&gt;  Geometry geometry = row[geometryColumn] as Geometry;&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;In this first part, we will only support rendering points, so the next stop would be to limit by geometry type:&lt;/p&gt;&lt;pre&gt;if (geometry == null || !geometry is ESRI.ArcGIS.ADF.Web.Geometry.Point)&lt;br&gt;  return;&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;Next we can use System.Drawing classes to draw an image at the point, which completes our very simple point renderer:&lt;/p&gt;&lt;pre&gt;ESRI.ArcGIS.ADF.Web.Geometry.Point p = geometry as ESRI.ArcGIS.ADF.Web.Geometry.Point;&lt;br&gt;using(System.Drawing.Image img = System.Drawing.Image.FromFile(@"C:\inetpub\wwwroot\myApp\images\icon.png"))&lt;br&gt;{&lt;br&gt;  graphics.DrawImageUnscaled(img,Convert.ToInt32(p.X),Convert.ToInt32(p.Y));&lt;br&gt;  img.Dispose();&lt;br&gt;}&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;Here’s the complete renderer implementation:&lt;/p&gt;&lt;pre&gt;using System;&lt;br&gt;using System.Collections.Generic;&lt;br&gt;using System.Text;&lt;br&gt;using ESRI.ArcGIS.ADF.Web.Geometry;&lt;br&gt;using ESRI.ArcGIS.ADF.Web.Display.Swatch;&lt;br&gt;using ESRI.ArcGIS.ADF.Web.Display.Symbol;&lt;br&gt;&lt;br&gt;namespace WebADF.Datasources.Renderers&lt;br&gt;{&lt;br&gt;	public class SimplePointRenderer : ESRI.ArcGIS.ADF.Web.Display.Renderer.IRenderer&lt;br&gt;	{&lt;br&gt;		public SwatchCollection GenerateSwatches(SwatchInfo swatchInfo, string fileName,&lt;br&gt;          string minScale, string maxScale)&lt;br&gt;		{&lt;br&gt;			return new SwatchCollection();&lt;br&gt;		}&lt;br&gt;		public void GetAllSymbols(List&amp;lt;FeatureSymbol&amp;gt; symbols) { }&lt;br&gt;&lt;br&gt;		public void GetMaxSwatchDimensions(ref int width, ref int height) { }&lt;br&gt;&lt;br&gt;		public void Render(System.Data.DataRow row, System.Drawing.Graphics graphics, &lt;br&gt;          System.Data.DataColumn geometryColumn)&lt;br&gt;		{&lt;br&gt;			if (row == null || graphics == null || geometryColumn == null)&lt;br&gt;				return;&lt;br&gt;			Geometry geometry = row[geometryColumn] as Geometry;&lt;br&gt;			if (geometry == null || !(geometry is ESRI.ArcGIS.ADF.Web.Geometry.Point))&lt;br&gt;				return;&lt;br&gt;&lt;br&gt;			ESRI.ArcGIS.ADF.Web.Geometry.Point p = geometry as ESRI.ArcGIS.ADF.Web.Geometry.Point;&lt;br&gt;			using (System.Drawing.Image img = System.Drawing.Image.FromFile(ImageIcon))&lt;br&gt;			{&lt;br&gt;				graphics.DrawImageUnscaled(img, Convert.ToInt32(p.X – img.Width/2), &lt;br&gt;                   Convert.ToInt32(p.Y) - img.Height/2);&lt;br&gt;				img.Dispose();&lt;br&gt;			}&lt;br&gt;		}&lt;br&gt;&lt;br&gt;		public object Clone() { return this.MemberwiseClone(); }&lt;br&gt;&lt;br&gt;		private string imageIcon = @"C:\inetpub\wwwroot\myApp\images\icon.png";&lt;br&gt;&lt;br&gt;		public string ImageIcon&lt;br&gt;		{&lt;br&gt;			get { return imageIcon; }&lt;br&gt;			set { imageIcon = value; }&lt;br&gt;		}	&lt;br&gt;	}&lt;br&gt;}&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;If you create a graphics dataset, you can now apply this renderer to your individual FeatureGraphicsLayers. You can easily extend it to use any of the existing attributes in the DataRow to determine which image icon to use, making it a simple thematic map renderer.&lt;/p&gt;
&lt;p&gt;Points are simple to render, but it gets slightly trickier with lines and polygons. We will have to convert these to a System.Drawing.GraphicsPath instance that the graphics object knows how to render. This is fairly straightforward, but to save you the trouble here are the methods needed to perform this conversion:&lt;/p&gt;&lt;pre&gt;public static GraphicsPath PolygonToPath(Polygon polygon)&lt;br&gt;{&lt;br&gt;    GraphicsPath path = new GraphicsPath();&lt;br&gt;    foreach (Ring p in polygon.Rings)&lt;br&gt;    {&lt;br&gt;        path.AddPolygon(pointCollectionToPointArray(p.Points));&lt;br&gt;        foreach (Hole ring in p.Holes)&lt;br&gt;            path.AddPolygon(pointCollectionToPointArray(ring.Points));&lt;br&gt;    }&lt;br&gt;    return path;&lt;br&gt;}&lt;br&gt;&lt;br&gt;public static GraphicsPath PolylineToPath(Polyline polyline)&lt;br&gt;{&lt;br&gt;    GraphicsPath path = new GraphicsPath();&lt;br&gt;    foreach (Path line in polyline.Paths)&lt;br&gt;    {&lt;br&gt;        path.AddLines(pointCollectionToPointArray(line.Points));&lt;br&gt;    }&lt;br&gt;    return path;&lt;br&gt;}&lt;br&gt;&lt;br&gt;private static Point[] pointCollectionToPointArray(PointCollection points)&lt;br&gt;{&lt;br&gt;    Point[] pointArr = new Point[points.Count];&lt;br&gt;    for (int i = 0; i &amp;lt; points.Count; i++)&lt;br&gt;    {&lt;br&gt;        pointArr[i] = new Point(Convert.ToInt32(points[i].X), Convert.ToInt32(points[i].Y));&lt;br&gt;    }&lt;br&gt;    return pointArr;&lt;br&gt;}&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;This is essentially all we need to make a renderer supporting all geometry types. Example:&lt;/p&gt;&lt;pre&gt;using (GraphicsPath path = PolygonToPath(polygon)); //or PolylinetoPath for polylines&lt;br&gt;{&lt;br&gt;	using (Pen pen = new Pen(System.Drawing.Colors.Black,1))&lt;br&gt;	{&lt;br&gt;		graphics.DrawPath(pen, path);&lt;br&gt;		pen.Dispose();&lt;br&gt;	}&lt;br&gt;	path.Dispose();&lt;br&gt;}&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;If you want to show the feature with a fill, remember to also use FillPath prior to drawing the outline as shown above:&lt;/p&gt;&lt;pre&gt;using (SolidBrush brush = new SolidBrush(System.Drawing.Colors.Red))&lt;br&gt;{&lt;br&gt;    graphics.FillPath(brush, path);&lt;br&gt;    brush.Dispose();&lt;br&gt;}&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;Using the principles described in this article, I’ve created a &lt;a href="http://serverapps.esri.com/CustomRenderers/Washington.aspx"&gt;2.5D renderer that can extrude polygons and lines&lt;/a&gt; based on a numeric attribute. The effect is very much like what you might have seen Google Maps using to show simple building outlines in metropolitan areas. You can indeed use it for this, or you can choose to extrude polygons based on for instance population density or whatever you want to show. I won’t go through the details of the code here, but most of the code is used for building a 3D-like mesh of a polygon and figuring out how to shade it depending on the direction of an imaginary light-source.&lt;/p&gt;
&lt;h4&gt;Adding support for legends&lt;/h4&gt;
&lt;p&gt;As mentioned in the beginning, we skipped implementing support for the table of contents control, and in many use cases of custom renderers (like displaying results) this is not needed. However adding support for TOC is fairly straightforward.&lt;/p&gt;
&lt;p&gt;We can reuse existing functionality in the ADF to render our symbols. Let’s say we have a point layer using three image symbols, 1.gif, 2.gif and 3.gif. We use the RasterMarkerSymbol and the SwatchUtility to render our swatches.&lt;/p&gt;&lt;pre&gt;public &lt;br&gt;SwatchCollection GenerateSwatches(SwatchInfo swatchInfo, string fileName, string minScale, string maxScale) {&lt;br&gt;SwatchCollection&lt;br&gt;	swatches = new SwatchCollection(); SwatchUtility&lt;br&gt;	swatchUtil = new SwatchUtility(swatchInfo); for(int&lt;br&gt;	i= 1;i&amp;lt;=3;i++) {&lt;br&gt;		CartoImage img = swatchUtil.DrawNewSwatch(new RasterMarkerSymbol(&lt;br&gt;			Server.MapPath(string.Format("~/images/{0}.gif", i))), null);&lt;br&gt;		swatches.Add(new Swatch(img, "Marker #" + i.ToString(), null, null));&lt;br&gt;	}&lt;br&gt;	return swatches;&lt;br&gt;}&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;This will return a collection of 3 images to use for the legend. When adding a TOC to the page, you'll see something like the following:&lt;br&gt;&lt;br&gt;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2744/original.aspx" title="Swatch images in TOC" style="width:182px;height:121px;" alt="Swatch images in TOC" height="121" width="182"&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://resources.esri.com/arcgisserver/adf/dotnet/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=15663"&gt;Get the Custom Renderer sample from the Code Gallery&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Contributed by Morten Nielsen of the ArcGIS Server .NET software development team.&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2742" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term=".NET" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/.NET/default.aspx" /><category term="Code Snippet" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Code+Snippet/default.aspx" /></entry><entry><title>ArcGIS Server 9.3 Nationwide Seminar Series occurring now</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/02/ArcGIS-Server-9.3-Nationwide-Seminar-Series-occurring-now.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/10/02/ArcGIS-Server-9.3-Nationwide-Seminar-Series-occurring-now.aspx</id><published>2008-10-02T20:01:00Z</published><updated>2008-10-02T20:01:00Z</updated><content type="html">&lt;p&gt;ESRI has been working on two, half-day &lt;a href="http://www.esri.com/events/seminars/arcgis93_server/index.html"&gt;
				ArcGIS Server 9.3 Seminars&lt;/a&gt;. These seminars started September 23rd and 
			are taking place through November within the U.S. This is a great opportunity 
			to see how to implement ArcGIS Server to its fullest capabilities.&lt;/p&gt;
		&lt;p&gt;The first seminar, which takes place during the morning, is “Tips and Tricks”. 
			It was derived by gathering the most common questions people have when 
			implementing ArcGIS Server and best practices. There are three main sections: 
			configuration and management, caching, and geoprocessing. This seminar provides 
			useful tips for configuring ArcGIS Server and understanding architecture, how 
			you can set up caching strategies and workflows for high performing web 
			applications and how to author and publish geoprocessing services for advanced 
			analysis over the web.&lt;/p&gt;
		&lt;p&gt;The second seminar, which takes place during the afternoon, is titled “Creating 
			Mashups Using the ArcGIS API for JavaScript”. The ArcGIS Server API for 
			JavaScript is new at 9.3 and provides html and JavaScript developers a quick 
			path for making great web mapping applications. This seminar covers the basics 
			and getting started with the API for JavaScript. In addition to creating 
			mashups, discussion on query tasks, geoprocessing, geocoding and other topics 
			are covered so you can see how GIS analysis can be done over this easy to use 
			API. You can take a quick glance of the demos that will be discussed by 
			downloading the sample code from the ArcGIS JavaScript API &lt;a href="http://resources.esri.com/arcgisserver/apis/javascript/arcgis/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=15815"&gt;
				Code Gallery&lt;/a&gt;.&lt;/p&gt;
		&lt;p&gt;Both seminars provide a great resource for maximizing the potential of ArcGIS 
			Server. The seminars also provide workbooks to attendees so they can revisit 
			the useful tips back in the office. Sign up online to attend an &lt;a href="http://www.esri.com/events/seminars/arcgis93_server/index.html"&gt;
				ArcGIS Server 9.3 Seminar&lt;/a&gt;.&lt;/p&gt;
		&lt;p&gt;The ESRI technical staff hope to see you at a seminar in a city near you!&lt;/p&gt;
		&lt;p&gt;&lt;i&gt;Contributed by Jeremiah Lindemann, co-designer of the "Creating Mashups Using the 
				ArcGIS API for JavaScript" seminar.&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2719" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term="Map Cache" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Map+Cache/default.aspx" /><category term="Geoprocessing" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Geoprocessing/default.aspx" /><category term="Beginners" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Beginners/default.aspx" /><category term="JavaScript" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/JavaScript/default.aspx" /><category term="Administration" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Administration/default.aspx" /><category term="9.3" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/9.3/default.aspx" /></entry><entry><title>Video explains "Parcel Notification List" JavaScript example</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/09/30/Video-explains-_2200_Parcel-Notification-List_2200_-JavaScript-example.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/09/30/Video-explains-_2200_Parcel-Notification-List_2200_-JavaScript-example.aspx</id><published>2008-09-30T17:09:00Z</published><updated>2008-09-30T17:09:00Z</updated><content type="html">	
&lt;p&gt;Currently the most popular download on the &lt;a href="http://resources.esri.com/arcgisserver/apis/javascript/arcgis/index.cfm?fa=codeGallery"&gt;
				ArcGIS JavaScript API Code Gallery&lt;/a&gt; is the &lt;a href="http://resources.esri.com/arcgisserver/apis/javascript/arcgis/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=15683"&gt;
				Parcel Notification List&lt;/a&gt; application written and submitted by Jeff 
			Archer from ESRI. In &lt;a href="http://downloads2.esri.com/edn/mediacenter/wmv/ArcGISJSAPI_ParcelNotifSample.wmv" target="_blank"&gt;
				this video&lt;/a&gt; Jeff takes a few minutes to show how the sample works and 
			gives a quick run-through of the code and components under the hood.&lt;/p&gt;
		
&lt;p&gt;While local governments may be able use the application "as-is", there is enough 
			starter material for any Web application that needs to select features based on 
			a distance from other features and return tabular attributes of the results.&lt;/p&gt;
		
&lt;p&gt;Download it, use it, modify it... it's up to you. And please leave comments on 
			&lt;a href="http://resources.esri.com/arcgisserver/apis/javascript/arcgis/index.cfm?fa=codeGalleryDetails&amp;amp;scriptID=15683"&gt;the download page&lt;/a&gt; if you have any questions or suggestions you think might help.&lt;/p&gt;
		
&lt;p&gt;&lt;i&gt;Contributed by Jim Barry of the EDN team.&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2714" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term="Geoprocessing" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Geoprocessing/default.aspx" /><category term="JavaScript" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/JavaScript/default.aspx" /><category term="Videos" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Videos/default.aspx" /><category term="9.3" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/9.3/default.aspx" /><category term="Dojo" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Dojo/default.aspx" /></entry><entry><title>Using 9.3 Web ADF controls in an ASP.NET Web Part and SharePoint 2007</title><link rel="alternate" type="text/html" href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/09/25/Using-9.3-Web-ADF-controls-in-an-ASP.NET-Web-Part-and-SharePoint-2007-.aspx" /><id>http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/09/25/Using-9.3-Web-ADF-controls-in-an-ASP.NET-Web-Part-and-SharePoint-2007-.aspx</id><published>2008-09-25T16:32:00Z</published><updated>2008-09-25T16:32:00Z</updated><content type="html">&lt;p&gt;My &lt;a href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2008/02/27/Using-Web-ADF-controls-in-an-ASP.NET-Web-Part-and-SharePoint-2007.aspx"&gt;previous post&lt;/a&gt; about integrating 9.2 Web ADF controls in ASP.NET Web Parts discussed a number of workarounds required to successfully utilize ADF controls within a Web Part. For 9.3 the ArcGIS Server .NET development team took some time to evaluate and fix any issues encountered while using ADF controls in a custom user control, composite control or ASP.NET Web Part. We tested Web Part deployment within SharePoint 2007 and confirmed that it worked without any ADF specific workarounds. As a result, the 9.3 Web ADF provides a solid foundation for integrating GIS components in Web Parts designed for SharePoint deployment.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://serverapps.esri.com/BlogDownloads/2008/Common_CustomControls.zip"&gt;Click here to download a comprehensive Web ADF-Web Part sample (C# and VB.NET).&lt;/a&gt; The sample code includes two projects: a class library which contains Web Parts, and a Web application to assist in deployment and testing.  The sample also includes a ReadMe.txt to get started and a Word document which steps through the SharePoint 2007 deployment process for ASP.NET AJAX-enabled Web Parts.&lt;/p&gt;    

&lt;p&gt;The class library project (ADFWebPart) contains two Web Parts: MapWebPart and MapGridViewWebPart. MapWebPart contains MapResourceManager, Map,Toolbar, and Toc controls. This sample illustrates how to add, structure, and initialize the aforementioned controls, add a custom tool, and expose properties for use in SharePoint.&lt;/p&gt; 

&lt;p&gt;MapGridViewWebPart contains a MapResourceManager and Map. It also contains an UpdatePanel with a GridView. It requires that a ScriptManager be in the page to enable asynchronous updates of the GridView (via the UpdatePanel).&lt;/p&gt;   

&lt;p&gt;This sample illustrates how to work with interactive graphics in the client via a map and table. A selection set is generated from a feature layer in an ArcGIS Server map service and managed as a Web-tier graphics layer. The graphics layer is rendered on the client using Web ADF JavaScript graphic features. Attributes of the selected set of features are displayed in the GridView. The visible fields and alias can be explicitly defined. Hovering over a row in the table will highlight the corresponding graphic feature in the map. Clicking on the row will zoom or pan to the feature.&lt;/p&gt;

&lt;p&gt;All properties for setting the dynamic resource, data layer for display, feature limits and field aliases are public and presentable within SharePoint. An ArcGIS Online cached map service (StreetMap) is used as a background map resource to provide spatial context.&lt;/p&gt;    

&lt;p&gt;The following screenshot provides an example of both Web Parts deployed within SharePoint 2007.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;img src="http://blogs.esri.com/Dev/photos/2008_server/images/2684/original.aspx" title="Web Parts in Share Point" alt="Web Parts in Share Point" width="534" height="455"&gt;&lt;/p&gt;

&lt;p&gt;To utilize either Web Part outside of SharePoint or to test before SharePoint deployment, use the file system Web application (CustomControlsWebSite) included with the sample.  The Web application contains a simple aspx page designed to emulate a runtime scenario where an end user wants to add a Web Part within the current session.  To personalize the page (e.g. add a Web Part at runtime) the current session must be associated with an authenticated user. By default, a file system Web site will use integrated authentication. If deploying as a Web application in IIS, you will need to disable anonymous access to the Web application in IIS. Enabling integrated authentication may offer the easiest solution since you do not need to configure or explicitly define authentication details; instead the authenticated user will be the user account under which the client (browser) is running.&lt;/p&gt;

&lt;p&gt;The default personalization provider for ASP.NET 2.0 is SQL Express. If you do not have SQL Express installed, a personalization store will not be created (upon initial execution of the application) and an error will be returned when attempting to add the custom Web Part to the page at runtime. To alleviate this requirement, the Web site uses a custom personalization provider that stores information in text files. The code, markup, and discussion for this technique is provided in the Microsoft article &lt;a href="http://msdn2.microsoft.com/en-us/library/aa479037.aspx"&gt;Web Parts Personalization Providers&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;i&gt;Contributed by Rex Hansen of the ArcGIS Server .NET software development team&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.esri.com/Dev/aggbug.aspx?PostID=2685" width="1" height="1"&gt;</content><author><name>sterlingdq</name><uri>http://blogs.esri.com/Dev/members/sterlingdq.aspx</uri></author><category term="Web Parts" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/Web+Parts/default.aspx" /><category term="SharePoint" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/SharePoint/default.aspx" /><category term="9.3" scheme="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/tags/9.3/default.aspx" /></entry></feed>