Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 5th, 2006, 10:22 AM
Friend of Wrox
 
Join Date: Apr 2006
Location: , , .
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default how inserting more bitmap graphics in a page?

Hi,

I made a webform for a survey, with multiple-choice questions. The results of each question are put into tables, one table per question, like:
values frequency
1 6
2 3
3 32
4 26
5 12

Now i want to add a graphic using the Namespace "System.Drawing" beside the table representing those values. So i
use two files, the second containing the code for the graphic.
I tried two ways: with a cookie (i know, not the best way) and with requeststring. Everything works, except that the second file has no time to create and render the graphic.
This happens in a loop: the first table is made, then the cookie or requeststring is sent together with the reference to file 2 where the graphic is created, then next table etc ...

My problem:
When using a cookie, each graphic appears beside its table in file 1 but all with the values of the last table (the value of the last send cookie).
When using a parameter, only the graphic of the last question is rendered (with the right values).

I thing it's a matter of speed: file 2 has no enough time to produce and send the graphic to file 1.
Any way to solve this?

Thanks

My code:

file1: (with parameter)
-----
'valtopass is the string containing the values to pass with ':' as separator
(e.g. 6:3:32:26:12)
...
 For j = 1 To numberoffield
'create table
...
 gr.ImageUrl = "graf2.aspx?v1=" & valtopass
 form1.Controls.Add(gr)
next
...

file1: (with cookie)
-----
'valtopass is the string containing the values to pass with ':' as separator
(e.g. 6:3:32:26:12)
'cok = HttpCookie
...
 For j = 1 To numberoffield
'create table
...
 cok.value=valtopass
 response.cookies.add(cok)
 next
...


file2 (graphic)
-----
Dim objBitmap As New Bitmap(40 * l, 124)
....
Response.ContentType = "image/gif"
objBitmap.Save(Response.OutputStream, ImageFormat.Gif)







Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 4: Page 394 - Inserting ScriptManager VeganMan BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 April 17th, 2008 08:41 PM
Inserting "fileneme.swf" file into a page labelle ASP.NET 2.0 Basics 0 January 19th, 2007 11:24 AM
Inserting records to Oracle db from asp page jowjow Classic ASP Basics 0 April 4th, 2006 09:24 AM
inserting records in oracle from asp page jowjow Oracle ASP 0 April 4th, 2006 09:17 AM
Chapt 8 Try it out (Inserting).. Page 273 Robert Reno BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 4 February 9th, 2006 06:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.