Reputation: 87
I am using google maps API to load streets in a textbox.It is working properly.My problem is that on postback the initialize method in javascript is not working and data is not loading
I am using
function initialize() { //my code } google.maps.event.addDomListener(window, 'load', initialize);
Please help me
Upvotes: 0
Views: 1596
Reputation: 1879
You will need to re-initialize the map on post-back as the code will not run again. If you are using an UpdatePanel a way to do this would be to bind to the end_RequestHandler
i.e.
var prm = window.Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(endRequestHandler);
function endRequestHandler()
{
// Initialize the map again
}
Upvotes: 4