Click here to Skip to main content
15,887,746 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Dynamically created controls Pin
orsela15-Oct-07 21:36
orsela15-Oct-07 21:36 
AnswerRe: Dynamically created controls Pin
Laxmikant Lad15-Oct-07 18:03
Laxmikant Lad15-Oct-07 18:03 
GeneralRe: Dynamically created controls Pin
orsela15-Oct-07 21:42
orsela15-Oct-07 21:42 
GeneralRe: Dynamically created controls Pin
Laxmikant Lad15-Oct-07 22:47
Laxmikant Lad15-Oct-07 22:47 
GeneralRe: Dynamically created controls Pin
orsela16-Oct-07 3:43
orsela16-Oct-07 3:43 
Questionunbound grid control in ASP.net Pin
uddhab15-Oct-07 5:04
uddhab15-Oct-07 5:04 
Question"This is an invalid webresource request." Pin
szukuro15-Oct-07 4:55
szukuro15-Oct-07 4:55 
QuestionAJAX: using UpdatePanel with DataList Pin
Talal Sultan15-Oct-07 3:53
Talal Sultan15-Oct-07 3:53 
Hi all,

I have a user control with one datalist that displays thumbnails of pictures stored in the database. In the same user control, I have an Image control where I would like to display a zoomed version of the picture when the user clicks on one of the thumbnails of the datalist.

In the datalist, I have ImageButton controls to show the thumbnails. When the user clicks a thumbnail, I get the item index and retrieve the corresponding image from the dataset in the session. The image is stored as a byte array. I save the image in another session variable that will be used by an ASPX page to display it. I point the ImageUrl of my Image control to that ASPX page.

The ItemCommand event handler is as follows:

protected void dlVisuals_ItemCommand(object source, DataListCommandEventArgs e)
    {
        int index = e.Item.ItemIndex;
        DataRow dr = sessionParams.SiteDS.Tables["TempVisuals"].Rows[index];
        Session["VisualZoom"] = SiteServices.GetThumbnail((byte[])dr[2], 300, 300);
        imgZoomFeature.ImageUrl = "ZoomVisualImage.aspx";
        imgZoomFeature.Visible = true;
    }


The aspx code to show the image is as follows:

if (Session["VisualZoom"] != null)
       {
           Bitmap bmp = new Bitmap(new MemoryStream((byte[])Session["VisualZoom"]));

           bmp.Save(Response.OutputStream, ImageFormat.Jpeg);
       }



I have put the datalist AND the Image control in an UpdatePanel and set the trigger to the ItemCommand event of the datalist.

The code works fine for the FIRST click only, i.e. when the user clicks on a thumbnail after the user control has been loaded. Subsequent clicks do not have any effect on the Image control. I have stepped into the code and I verified that the event handler is being called correctly at each thumbnail click. It seems that the ASPX page displaying the image is not working properly. I put a breakpoint in it but the program doesn't stop at it.

Any ideas?

Thanks,
Talal

-- If this is a post that has been helpful to you, please vote for it. Thank you!

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook

QuestionWarning during compile - Unable to update auto refesh reference Pin
Md Arif15-Oct-07 2:40
Md Arif15-Oct-07 2:40 
AnswerRe: Warning during compile - Unable to update auto refesh reference Pin
Sandeep Akhare15-Oct-07 3:39
Sandeep Akhare15-Oct-07 3:39 
GeneralRe: Warning during compile - Unable to update auto refesh reference Pin
Md Arif15-Oct-07 4:13
Md Arif15-Oct-07 4:13 
QuestionAjax Extensions: using update panel w/validation. Pin
Dio2215-Oct-07 2:13
Dio2215-Oct-07 2:13 
AnswerRe: Ajax Extensions: using update panel w/validation. Pin
John-ph15-Oct-07 2:32
John-ph15-Oct-07 2:32 
GeneralRe: Ajax Extensions: using update panel w/validation. Pin
Dio2215-Oct-07 3:06
Dio2215-Oct-07 3:06 
QuestionPopulate The Popup Window without refreshing Parent Page. Pin
codeproject_Tarun15-Oct-07 1:42
codeproject_Tarun15-Oct-07 1:42 
AnswerRe: Populate The Popup Window without refreshing Parent Page. Pin
mareers15-Oct-07 1:52
mareers15-Oct-07 1:52 
GeneralRe: Populate The Popup Window without refreshing Parent Page. Pin
Sandeep Akhare15-Oct-07 1:56
Sandeep Akhare15-Oct-07 1:56 
GeneralRe: Populate The Popup Window without refreshing Parent Page. Pin
mareers15-Oct-07 2:01
mareers15-Oct-07 2:01 
QuestionPopulate The Popup Window without refreshing Parent Page. Pin
codeproject_Tarun15-Oct-07 1:42
codeproject_Tarun15-Oct-07 1:42 
AnswerRe: Populate The Popup Window without refreshing Parent Page. Pin
John-ph15-Oct-07 1:52
John-ph15-Oct-07 1:52 
QuestionConverting VB Script/WMI code into VB.NET Pin
Piyush Vardhan Singh15-Oct-07 1:28
Piyush Vardhan Singh15-Oct-07 1:28 
AnswerRe: Converting VB Script/WMI code into VB.NET Pin
Abhijit Jana15-Oct-07 3:16
professionalAbhijit Jana15-Oct-07 3:16 
GeneralRe: Converting VB Script/WMI code into VB.NET Pin
Piyush Vardhan Singh15-Oct-07 3:25
Piyush Vardhan Singh15-Oct-07 3:25 
GeneralRe: Converting VB Script/WMI code into VB.NET Pin
Piyush Vardhan Singh15-Oct-07 3:29
Piyush Vardhan Singh15-Oct-07 3:29 
GeneralRe: Converting VB Script/WMI code into VB.NET Pin
Abhijit Jana15-Oct-07 4:45
professionalAbhijit Jana15-Oct-07 4:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.