hi,
this is my code
<form runat="server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem>--Selectione--
<asp:ListItem>Qualitas
<asp:ListItem>ABHS
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<contenttemplate>
<div id="mapcanva" runat="server">
<asp:Literal ID="Literal1" runat="server">
</form>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script>
function initialize() {
var myLatlng = new google.maps.LatLng(33.596854, -7.604025);
var mapOptions = {
zoom: 16,
center: myLatlng
};
var map = new google.maps.Map(document.getElementById('mapcanva'), mapOptions);
var contentString = 'Qualitas Environmental Solutions';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Qualitas'
});
google.maps.event.addListener(marker, 'click', function () {
infowindow.open(map, marker);
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList1.Text=="ABHS")
{
mapcanva.Visible = false;
}
else if (DropDownList1.Text == "Qualitas")
{
mapcanva.Visible = true;
}
}
when i selected item "ABHS" the div set visible to false but when i selecte "Qualitas" the div set visible to falsebut the map don't aprea i dont know why plz help me