Adrian,
ASP.NET doesn’t keep status. It generates a web page and dispose it immediately. After a postback, a brand new web page is generated which technically has no relationship with the previous one. For your case that means first the client side panning or zooming can not affect the Map1’s status at all, second, StaticMap only hooks up with the original Map1, in a postback, Map1 doesn’t share the same reference with staticMap any more as it’s a brand new object already. Add another button with the following codes you will see the Map1 and the staticMap are not the same.
protected void Button2_Click(object sender, EventArgs e)
{
System.Diagnostics.Debug.WriteLine("");
System.Diagnostics.Debug.WriteLine(Map1.CurrentExtent.Width.ToString());
System.Diagnostics.Debug.WriteLine(staticMap.CurrentExtent.Width.ToString());
}
Also according to my limited experience, we should try not using static variables in ASP.NET projects as sharing a variable across sessions can easily cause problems, also it might lead to some strange issues.
Hope that helps.
Thanks,
Ben