In graphRender.aspx I have GDI+ procedure for rendering
graph. It work for first time (when page is open) but when I click on some button to get other graph (for different parameters) I lose picture (get red x)
Does anyone have some example for dynamically render GDI+ image using JavaScript (without
UpdatePanel)
zivko
Member
4 Points
12 Posts
Ajax and GDI
Mar 14, 2008 12:36 PM|LINK
Hi, I have one graph render with GDI+ and now I want to render new graph over existing dinamically.Graph is render in image object:
<asp:image id="imgGrafikon" ImageUrl="graph1.aspx" runat="server" />
I have javascript function for dinamic render image.
function Graph()
{
var url="Ajax/graphRender.aspx";
url=url+"&idrnd="+Math.random();
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Non AJAX!");
return;
}
xmlHttp.onreadystatechange=GraphShow;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function GraphShow()
{
if (xmlHttp.readyState==4)
{
var sadrzaj;
sadrzaj=xmlHttp.responseText;
document.getElementById("imgGrafikon").src = sadrzaj;
}
}
In graphRender.aspx I have GDI+ procedure for rendering graph. It work for first time (when page is open) but when I click on some button to get other graph (for different parameters) I lose picture (get red x)
Does anyone have some example for dynamically render GDI+ image using JavaScript (without UpdatePanel)
Chris Pebble
Participant
925 Points
146 Posts
Re: Ajax and GDI
Mar 14, 2008 06:18 PM|LINK
What you're doing should work. What value is sadrzaj being set to? Make sure the path that it is returning is a valid virtual or complete path.
Unfortunately that's all the assist I can give without seeing the code in graphRender.aspx.
zivko
Member
4 Points
12 Posts
Re: Ajax and GDI
Apr 15, 2008 07:17 AM|LINK
I solve it with another div tag in wich I loaded GDI object.