This project is read-only.

map.Overlays.Add(polygon) throws InvalidOperationException

Mar 29, 2012 at 7:49 PM

I'm adding a polygon to an instance of the GoogleMap control and it works fine the first time the page is loaded, but if I refresh the page, I get the following error.  Any ideas how to fix this?

System.InvalidOperationException: Extender controls may not be registered after PreRender.


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="CleanAir.PlotComplaints.WebForm1" %>

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
        <asp:ScriptManager ID="scriptManager" runat="server" />
        <artem:GoogleMap ID="map" runat="server" Height="100%" Width="100%" Address="Seattle, WA" />


using System;

namespace CleanAir.PlotComplaints
    public partial class WebForm1 : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
   = Artem.Google.UI.MapType.Roadmap;
   = "Seatac, WA";
   = 10;


        private void DrawPointsOfInterest()