When the control is rendered in a page, a AJAX TabContainer does not display. It's just a blank space where the TabContainer is supposed to display. Strangely, alert(document.getElementById(\"div1\")) does display an alert dialog, but nothing else. And, alert('From
loadMap()') does not display the expected alert dialog.
However, if I change the last parameter of RegisterStartupScript from true to false, the TabContainer does display with out the google map I am trying to display.
Another thing I noticed is that my page contains another control, which contains a few panels and a CollapsiblePanelExtender. When I click on this control's image control for expanding and collapsing on the page, the TabContainer in the first control displays.
Really bizarre.
The only things certain in life are death and taxes.
kochoo
Member
8 Points
35 Posts
Script not working
Jan 21, 2009 05:26 PM|LINK
ClientScriptManager clientScriptManager = Page.ClientScript; string script = "function loadMap() { alert('From loadMap()'); if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById(\"div1\")); map.setCenter(new GLatLng(" + facility.Single().Latitude + ", " + facility.Single().Longitude + "), 13); }";
if (!clientScriptManager.IsClientScriptBlockRegistered("Map")) clientScriptManager.RegisterClientScriptBlock(this.Page.GetType(), "Map", script, true);
clientScriptManager.RegisterStartupScript(this.GetType(), "LoadMap", "alert(document.getElementById(\"div1\"));loadMap();", true);
When the control is rendered in a page, a AJAX TabContainer does not display. It's just a blank space where the TabContainer is supposed to display. Strangely, alert(document.getElementById(\"div1\")) does display an alert dialog, but nothing else. And, alert('From loadMap()') does not display the expected alert dialog.
However, if I change the last parameter of RegisterStartupScript from true to false, the TabContainer does display with out the google map I am trying to display.
Another thing I noticed is that my page contains another control, which contains a few panels and a CollapsiblePanelExtender. When I click on this control's image control for expanding and collapsing on the page, the TabContainer in the first control displays. Really bizarre.