I am working on a form Image.aspx and I want to upload an image, resize it and display it in a new window.
Here I am uploading the image,
UploadPath = Server.MapPath("../BrandPic/" + cmbImages.SelectedValue);
FileName = cmbImages.SelectedValue;
Bitmap OriginalBM = new Bitmap(UploadPath);
Here I am resizing it
int NewWidth = 1024;
int newHeight = 768;
Size newSize = new Size(NewWidth, newHeight);
Bitmap ResizedBM = new Bitmap(OriginalBM, newSize);
Here I am passing it
HttpContext.Current.Session["Pic"] = ResizedBM;
Here is my source code to open the image in new window
<a href='<%=Convert.ToString(HttpContext.Current.Session["Pic"])%>' rel="lightbox" >
But there is an error occured. Check the URL. So any idea to solve this issue ???