This project is read-only.


Apr 16, 2008 at 6:23 PM
Since 3.0 I have seen this error: Sys.Webforms.PageRequestManagerServerErrorException: An Unknown error occured while processing the request on the server. The status code returned from the server was: 500.

When i go back to 2.95 the error goes away.

I have other update panels on the same page and have both included the google control inside and outside another update panel and see the same error.

Do you know what changed from 2.95 to 3.0, 3.3 that could cause this error? Any help is greatly appreciated.

Apr 16, 2008 at 6:42 PM
Edited Apr 16, 2008 at 7:13 PM
Update to the following Error,

The error is raised when i use the .text property and load HTML coding as the validation is raised.
Here is what i am setting the "text" property to:

marker.text = "<a href=""destination/test.aspx"">"

Without having to disable event validation, is there another way to load the info window with hyperlinks and html code? How does the infowindowcontent property work? Do you have a sample to load this in the behind code?

Thanks again!
Apr 16, 2008 at 8:27 PM
Edited Apr 16, 2008 at 8:29 PM

What have changed since version 3.0 is I have added InfoWindowContent inner template to GoogleMarker.
The idea is that you should use it when want to set some HTML as info window content of the marker.
You should use Text property just to set a pain text content to info window.
You can use InfoWindowContent like:
<artem:GoogleMarker Latitude="42.1229" Longitude="24.7879" Title="Click on the marker">
            Info Window Content</h1>
            This is an info window content template.</p>
The is no sense to add a template in the code behind, because you can get some dynamic content in it.
For example, like in you sample, let's say the page has method GetLinkUrl() that returns the proper Url:
<artem:GoogleMarker Latitude="42.1229" Longitude="24.7879" Title="Click on the marker">
        <a href="<%= this.GetLinkUrl() %>">Visit This Page</a>
And an example of exactly what you want to set as info window content:
<artem:GoogleMarker Latitude="42.1229" Longitude="24.7879" Title="Click on the marker">
        <a href="destination/test.aspx">Visit This Page</a>

Hope this helps
Apr 16, 2008 at 10:35 PM
Thank you for your help!. This is a great source.

One more question, how would I load then, using the method above to, multiple markers from a database? I was doing this all in the code behind.

Thank you again!
Apr 17, 2008 at 6:51 AM
Edited Apr 17, 2008 at 6:53 AM
As I have advertized sinse version 3.0 Data Bindind to any kind of DataSource was added.
You can take a look at Data Binding Sample , where I have bound markers to ObjectDataSource.
The page is included in Sample Website and you can take a look at the source, as well.
In short:
  • Add a DataSource to the page;
  • Set DataSourceID of GoogleMap Control to the ID of the DataSource;
  • Last you have to specify which columns/properties of DataSource go to Address or Latitude/Longitude and Text properties of the markers(using DataAddressField, DataLatitudeField, DataLongitudeField and DataTextField);
You can bind Address or Latitude/Longitude.
Here is an example where Address and Text are bound:
 <artem:GoogleMap ID="GoogleMap1" runat="server" Width="530px" Height="500px" Latitude="42.1229" Longitude="24.7879"
    Zoom="4" EnableScrollWheelZoom="true" BorderStyle="Solid" BorderColor="#999999" BorderWidth="1" DataSourceID="_odsMarkers"
    DataAddressField="Address" DataTextField="Description">
<asp:ObjectDataSource ID="_odsMarkers" runat="server" OldValuesParameterFormatString="{0}" SelectMethod="GetMarkersData"
In the example above Address property of GoogleMap control is set to Address field of the DataSource, but the Text property is bound to Description field DataTextField="Description".

Simple is that.