I've been attempting to trigger a JavaScript function upon the refresh of an update panel, but for some reason it's not working. Oddly enough, I'm using the same approach that has worked for other functions.
In C#, this is what I have in the page load event:
ScriptManager.RegisterStartupScript(
UpdatePanel1,
this.GetType(),
"Modify Map",
"modifyMap();",
true);
This is the JavaScript function:
function modifyMap() {
alert(1);
//To change the map size if the user is viewing the site on a mobile.
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
//Change width/height of map.
//Change the width of the wrapper to 100% of the screen.
document.getElementById('wrapper-div').style.width = "100%";
//Set the map to fill the wrapper.
document.getElementById('canvasMap').style.width = "100%";
//Set the height of the map.
document.getElementById('canvasMap').style.height = "500px";
}
}
If anyone can provide assistance, it would be greatly appreciated.
Thank you,
Callum