Postback problem

We have created an ASP.NET application in C#. on a couple of the pages we use
datagrid to display user records. one of the columns on this record is to
view an images which is displayed in a separate popup window. But while I am
clicking first time nothing is happening and displays the images only on the
second click. Can you figure it out why it is happening so? I want the images
to be displayed on the first click itself.

Advertisements

According to my experience, this problem usually occurs when you bound
ur script for popup on click event instead of Page_Load event. What i
mean is, you must b having a code say:

Button1.Attribute.Add("Onclick", "Window.open("TargetPage.aspx");

This code must be put in Page_Load or in ur case in ItemDataBound event
instead of click event or ItemCommand event. Please check if u r
binding this script code in ItemDataBound this might solve ur problem.

HTH

Oludan wrote:
> We have created an ASP.NET application in C#. on a couple of the pages we use
> datagrid to display user records. one of the columns on this record is to
> view an images which is displayed in a separate popup window. But while I am
> clicking first time nothing is happening and displays the images only on the
> second click. Can you figure it out why it is happening so? I want the images
> to be displayed on the first click itself.
>
> Regards,

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!