I have a div
on my ASP.NET page that contains a Google Map, and I need to show it and hide it but it does not work for me.
This is the code divided by lengaujes :
Javascript:
function ShowMap()
{
var mapa = document.getElementById('map');
mapa.display('block');
}
function HiddenMap()
{
var mapa = document.getElementById('map');
mapa.display('none');
}
ASP.NET:
<form id="form1" runat="server">
<div>
<div id="map" style="width:auto; height:390px; top:2%;display:none;">
</div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" Width="114px" />
<asp:Button ID="Button2" runat="server" Text="Button" Width="114px" OnClick="Button2_Click" />
</div>
</form>
C #:
protected void Button1_Click(object sender, EventArgs e)
{
String ScriptAct = "HiddenMap();";
ScriptManager.RegisterStartupScript(this, this.GetType(), "HiddenMap()", ScriptAct, true);
}
protected void Button2_Click(object sender, EventArgs e)
{
String ScriptAct = "ShowMap();";
ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowMap()", ScriptAct, true);
}