Jun 16, 2011, 5:59 AM
[CLOSED] Adding Google Marker From Code Behind
I am trying to add some google markers from code behind with additional method AddMarkers at GMapPanel.cs
[Meta]
[Description("")]
public virtual void AddMarkers(MarkerCollection mc)
{
this.Call("addMarkers", mc);
}
and then from example.cs, i adding these lines at page_loadprotected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Marker m = new Marker();
m.Lat = 10.1;
m.Lng = 10.2;
m.Listeners.Click.Handler = "Ext.Msg.alert('Confirm', String.format('You Clicked {0}', el.id));";
MarkerCollection mc = new MarkerCollection();
mc.Add(m);
CenterMap.AddMarkers(mc);
}
}
And my page raise a JsonSerializationException: error Error getting value from 'InnerHtml' on 'System.Web.UI.HtmlControls.HtmlHead'. I think i need to convert mc into json but i don't know how to do.. Please help for this problem
Last edited by Daniil; Jun 16, 2011 at 9:40 AM.
Reason: [CLOSED]