I created a map application which works fine with regular aspx and a meta refresh.
I would like to have the map itself update independently using ajax. (Sorry on the long post, I just started using ajax. This is on an IIS server and all ajax has just been downloaded and installed and functions with simple ajax web pages)
The map worked fine except the original script in C# uses a response.write:
(ie) Response.Write("<form action=StateStat.aspx method=post><input type=hidden name=STATE value='" + locstate + "'><input type=image ID='" + locstate + "' runat='server' src='Graphics/Status_Offline_s.gif' Style='left: " + xloc[statecount] + "; position: absolute; top: " + yloc[statecount] + "' Visible='True' alt='" + statename[statecount] + "\n" + statetotal + " Alerts\n" + statenames + "'></form>");
which in turn set the image in a form for the image click, set the x/y coords based on a state array and then layed the status icon image over the imagemap at specific coords based on the state. (This is looped through all 50 states)
When trying to do the same using ajax, I get a server error parse exception which dies at the "response.write" line of code, so I am thinking this (response.write) is not allowed on an ajax postback.
So instead of the respone write form method, I tried using imagebutton:
ImageButton MapAlert = new ImageButton();
MapAlert.ID = "Image" + alertcount;
MapAlert.ImageUrl = "~/Graphics/Status_Offline_s.gif";
MapAlert.PostBackUrl = "~/StateStat.aspx?STATE=" + locstate;
MapAlert.Style.Add(HtmlTextWriterStyle.Position, "Absolute");
MapAlert.Style.Add(HtmlTextWriterStyle.Left, xloc[statecount].ToString());
MapAlert.Style.Add(HtmlTextWriterStyle.Top, yloc[statecount].ToString());
// MapAlert.Style[HtmlTextWriterStyle.Position, "Absolute"];
// MapAlert.Style[HtmlTextWriterStyle.Left, xloc[statecount]];
// MapAlert.Style[HtmlTextWriterStyle.Top, yloc[statecount]];
MapAlert.ToolTip = statename[statecount] + "\n" + statetotal + " Alert\n" + statename;
MapAlert.Visible = true;
MapAlert.Enabled = true;
for each state. (I could be doing something wrong with creating the image layovers)
This functions without error, the map refreshes in the Ajax update panel, but I don't see any image icons. I am thinking that this may be due to the fact that in the state loop, the new imagebutton name is not being changed.
Any help would be appreciated, I have seen some good feedback here so thought I would give it a shot on the forum.