problem with generating dynamic images
-
I,m trying to generate 5 dynamic images with the user name on the run-time using system.drawing.imaging. Creation of images is done in a separate aspx file named dynImg.aspx. From a new aspx file , i'm calling the dynImg.aspx file with the name parameter. Below is the code i'm using: for i= 1 to 5 response.write("
") next My problem is, i'm able to generate only one image. Unable to load the other images. Need a solution for this imediately?????
-
I,m trying to generate 5 dynamic images with the user name on the run-time using system.drawing.imaging. Creation of images is done in a separate aspx file named dynImg.aspx. From a new aspx file , i'm calling the dynImg.aspx file with the name parameter. Below is the code i'm using: for i= 1 to 5 response.write("
") next My problem is, i'm able to generate only one image. Unable to load the other images. Need a solution for this imediately?????
The img tag only accepts image files. Since you are passing it a web page it is getting confused. Make your aspx into dymImg.ascx. Expose a public String in the class called Name. Then dynamically load the ascx into your web page in the 5 locations you need it. Use the public "Name" field in the ascx, and then render the controls on the screen. This should give you the desired result. Torin Blair
'In the immortal words of Socrates - "I drank what?".' -
The img tag only accepts image files. Since you are passing it a web page it is getting confused. Make your aspx into dymImg.ascx. Expose a public String in the class called Name. Then dynamically load the ascx into your web page in the 5 locations you need it. Use the public "Name" field in the ascx, and then render the controls on the screen. This should give you the desired result. Torin Blair
'In the immortal words of Socrates - "I drank what?".'tojamismis wrote: The img tag only accepts image files. Since you are passing it a web page it is getting confused. Sorry, but this is not true. The
img
tag will accept and process any URI specified in itssrc
attribute. As long as the stream returned is an image stream, with proper headers, it will display just fine. Google will yield plenty of results, if you'd like more information, but here is a proof of concept[^] to prove the point. Note the source of the image in the HTML. That being said, using a .aspx page is going to be much slower then implementing an HTTP handler to field the requests, and caching strategy will play a big part in response time. Dino Esposito wrote a nice article[^] on dynamic image generation. Hope that helps. :) --Jesse -
I,m trying to generate 5 dynamic images with the user name on the run-time using system.drawing.imaging. Creation of images is done in a separate aspx file named dynImg.aspx. From a new aspx file , i'm calling the dynImg.aspx file with the name parameter. Below is the code i'm using: for i= 1 to 5 response.write("
") next My problem is, i'm able to generate only one image. Unable to load the other images. Need a solution for this imediately?????
I'm not sure that I'm clear on what results you are seeing. Are you seeing 1 total image, or 5 of the same image? Here are a few thoughts that hit me looking at your snipit. It would probably help to have some additional information.
- Is the variable
name
being initialized somewhere? - Does
name
represent a legal value to your image server? - It doesn't appear that you are changing
name
in your loop... so if you are seeing 5 of the same image, that could be a reason why. - Do you see 5
img
tags in the HTML that is rendered to the browser?
That should be enough to get started. That being said, using a .aspx page is going to be much slower then implementing an HTTP handler to field the requests, and caching strategy will play a big part in response time. Dino Esposito wrote a nice article[^] on dynamic image generation that may give you some inspiration. Hope that helps. :) --Jesse
- Is the variable