【发布时间】:2012-07-10 10:50:02
【问题描述】:
此代码无效
protected void Page_Load(object sender, EventArgs e) { 如果(!IsPostBack) { 初始化服务器端(); 配置客户端(); } }
private void InitializeServerSide()
{
GLatLng latlng = new GLatLng(39, -0.5);
GMarker marker = new GMarker(latlng);
GMap1.Add(marker);
InitializeClientSide(marker.ID);
}
private void InitializeClientSide(string markerId)
{
btnGInfoWindow.Attributes.Add("onclick", string.Format("windowMe("+ markerId +");"));
}
private void ConfigureClientSide()
{
string js = string.Format(@"function windowMe(markerId){{var marker = getGMapElementById(subgurim_GMap1,markerId); marker.openInfoWindowHtml('Hello world!'); }}", GMap1.GMap_Id);
GMap1.addCustomJavascript(js);
}
【问题讨论】: