Click here to Skip to main content
15,791,541 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there,

I've a Bitmap image which is drawn from the Back end values.
I've created a User control to get the bitmap image.But when I place the user control inside my Aspx page, all other controls get vanished.Only the Bitmap image get displayed.How can I manage this issue??? I want to pass the flags for drawing image to back end via Aspx page, So the controls should be there (Visible)....

Thanks in advance....
Updated 28-Jan-18 7:56am

Put PlaceHolder control on your page, and put the image in that. Unless you need some sort of special profcessing, a UserControl isn't appropriate.
Share this answer
aswathy.s.88 16-May-11 8:13am    
No my output is directly to the bitmap in the User control not to an asp image....
bisharbn 16-May-11 11:14am    
How you are showing the image on the Usercontrol......i mean using any image server control or any other method....
aswathy.s.88 17-May-11 0:06am    
No I'm not using image server control... I just fetch it in a Bitmap object and displaying it....
Once, I wrote code to draw a captcha image, and this is how I got it on the page:

int imgHeight = 60;
int imgWidth = 160;
Bitmap objBMP = new System.Drawing.Bitmap(imgWidth, imgHeight);
Graphics objGraphics = System.Drawing.Graphics.FromImage(objBMP);

// Set the content type and return the image
Response.ContentType = "image/GIF";
objBMP.Save(Response.OutputStream, ImageFormat.Gif);
Share this answer
aswathy.s.88 17-May-11 7:14am    
Thanks for ur reply..
Yes that I agree... For me too the image is displayed in the web page... But the issue is when the bitmap is Displayed on the web page all other controls get vanished. How I can set to display the image in a specified portion only,not in the whole page..
#realJSOP 17-May-11 7:35am    
You have to find a way to inject it nto the response. The only way I know to do that is to put a html element (maybe a div), and then and image in the div with no source set. Finally, save the bitmap to a file and set the source of the image element to the file's url.
soheil bijavar 4-Jul-12 1:16am    
whit this soulotion all content page changed to image format and another control has to be disposed from page and unvisiable

please say another way to load bitmap class into the control on the page target of this job is a preview after resizing before save on physical adress

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900