Click to See Complete Forum and Search --> : Loading Variables from an ImageButton Click


ewj743
06-17-2005, 09:22 AM
I'm designing a page which will have a graphic loaded from a database using (I suspect) the ImageButton control. The graphic itself will display a thumbnail of a financial chart with some 'indicators' plotted on it.

What I'd like to do is allow the reader to click on the image, which would accomplish the following:

Launch a new (chart page) browser window (how?) which would display a full-page version of the chart, complete with indicators;

Load the same indicator variables into the new page as were used to plot the chart shown in the thumbnail, thus allowing the page to plot those indicators.

I was thinking that it might be easiest to simply define a DB table with records listing the image URL along with any variable values; the click event would pull these variables from the db and pass them along to the new page.

Is this clumsy? Is there a better way to accomplish this task?

Any ideas or help would be appreciated!

lmf232s
06-17-2005, 10:29 AM
well you can put an onclick event in the image which could call a javascript function
which would do what you want.

function OpenMe(var1, var2, var3){
window.open('chart.asp?v1='+var1+'&v2='+var2+'&v3='+var3, 'chartpage', 'height=400, width=400, toolbar=yes');
}

<img src="/images/chart.gif" onclick="OpenMe('value1', 'value2', 'value3');">

ewj743
06-20-2005, 05:45 AM
Thanks for the code!