Unable to Clear Markers

May 11, 2010 at 4:24 PM

I am loading 20 markers from my database every time I search for an address.  My issue is that every time I reload the page it keeps all of my old markers.  I am doing a clear on the Markers but that is not helping.  My code is below:

 

if (IsPostBack && !String.IsNullOrEmpty(txtAddress.Text))
            {
                String address = txtAddress.Text;
                
                GoogleMap1.Address = address;
                GoogleMap1.Markers.Clear();

 

        

        <asp:ScriptManager ID="ScriptManager" runat="server" AsyncPostBackTimeout="900" EnablePartialRendering="true" EnableViewState="false" />
        
        <asp:UpdatePanel ID="upTest" runat="server" EnableViewState="false">
            <ContentTemplate>
                Address:<asp:TextBox ID="txtAddress" runat="server" MaxLength="200" Width="200" />
                <asp:Button ID="btnSearch" runat="server" Text="Search" />
                <artem:GoogleMap ID="GoogleMap1" runat="server" Width="700px" Height="600px" DefaultMapView="Normal" EnableMarkerManager="true" OnAddressNotFound="HandleAny"
                    EnableScrollWheelZoom="true" EnableViewState="false" ZoomPanType="Large">
                </artem:GoogleMap>
            </ContentTemplate>
        </asp:UpdatePanel>