HOW TO
At design time, the InitialExtent property of a map control can be set to default or full.
Default uses the extent of the primary map resource. Full uses an extent that includes all resources in the map. To explicitly set the extent of the map control upon application initialization, add the appropriate code to the PreRender event of the page or map. The following procedure uses a custom Web ADF envelope to define the initial extent of the map.
Note:
The initial extent only needs to be set on the initial request to the application, not on every subsequent postback.
Code:
protected void Page_PreRender(object sender, EventArgs ea){
if (!Page.IsPostBack){
ESRI.ArcGIS.ADF.Web.Geometry.Envelope initextent = new
ESRI.ArcGIS.ADF.Web.Geometry.Envelope(-110, 30,-100, 40);
Map1.Extent = initextent;
}
}
Get help from ArcGIS experts
Download the Esri Support App