Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
Each instance of geometry (esri.geometry.Geometry) has a method called getExtent() which returns the extent of the geometry (polygon in your example). esri.geometry.Extent has a method called getCenter() that returns a point.
So you could do something like:
var myPolygonCenterLatLon = myPolygon.getExtent().getCenter();
You could alternatively calculate the centroids to polygons beforehand in ArcMap. Then host the layer which has a one-to-one relationship with the polygons.
You could set up a model in Model Builder to use the Feature to Point tool (in ArcToolbox), export the script (JScript), and call it in your code.
This example finds the centre point of the polygon to label the coordinates
This uses the Geometry Service http://webhelp.esri.com/arcgisserver/9.3/dotNet/index.htm#geometry_service.htm