After I successfully created my first google maps in asp.net with this question http://stackoverflow.com/questions/3897781/google-maps-api-in-asp-net-masterpage-why-it-stays-blank
I now want to change the maps lat, long when clicking with Go button. For this I just need to pass a new x,y at startupsctipt to GoogleMaps js function.
first load is ok, but it's no more OK on second load maps is empty, I can't see why:
public partial class _Default : System.Web.UI.Page
{
private String m_x;
private String m_y;
protected void Page_Load(object sender, EventArgs e)
{
String x;
String y;
if (!IsPostBack)
{
m_x = "48.854401";
m_y = "2.316923";
}
String script = "GoogleMaps('" + m_x + "," + m_y + ")";
ClientScript.RegisterStartupScript(this.GetType(), "GoogleMaps", script, true);
}
protected void ButtonGo_Click(object sender, EventArgs e)
{
m_x = "-34.397";
m_y = "150.644";
}
}