473,387 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Ajax Map Icons

2
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.
May 8 '07 #1
1 1960
pbmods
5,821 Expert 4TB
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;
Pssst! Code tags! Thanks.

I'm not familiar with this syntax. Is this JavaScript or C#?
May 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: drum118 | last post by:
Has anyone experience problems with firewall blocking some icons and not others. I am using Zone alarm and have the popup set for medium and it was blocking some of the icons for some strange...
24
by: Crom | last post by:
Ok. I want to settle this once and for all. After looking at the source for various, rather sizeable (but not all were so big) web sites that use icons that show up in the addressbar beside the...
3
by: sto | last post by:
look at this picture http://upload.cs99.net/e.gif i use the function SHGetFileInfo to get file icons. but these icons are not very nice. there are some black things round of the icons. many...
6
by: B-Dog | last post by:
Does anyone know where I can find some professional looking icons that are the standard windows collection for developers? The ones that came on the VS cd are pretty lame. Thanks
17
by: Brett | last post by:
I'd like references on where to find some good (quality) icons to use for form and application icons (for the EXE). Most of the free stuff isn't that great looking and there isn't a good...
2
by: SharpCoderMP | last post by:
i'm trying to embed multiple program icons in my executable. the only way so far i managed to do that is to embed native win32 resource file with multiple icons. it works, but... when i create a...
11
by: burtonfigg | last post by:
I've read this article: http://www.oracle.com/technology/pub/articles/oracle_php_cookbook/ullman-ajax.html And from reading it thought it'd be interesting to try a bit of Ajax on my site. ...
4
by: Sanoski | last post by:
This might be a dumb question. I don't know. I'm new to all this. How do you find icons for your programs? All GUI applications have cool icons that represent various things. For instance, to save...
10
by: dkyadav80 | last post by:
<html> /// here what shoud be java script for: ->when script run then not display all input text field only display selection field. ->when user select other value for institute only this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.