• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 170
  • Last Modified:

opening a gridview image in new page

i have a grid view control in c#.one of the itemtemplate field contain the link to an image.
iwant that when user clicks that field image shud be displayed in a new popup window
0
ASPNET_8
Asked:
ASPNET_8
  • 2
1 Solution
 
Kiran SonawaneProject LeadCommented:
Add link button to  aspx page
<asp:linkbutton id="LinkButton1"
       text="Open Web site"
       onclientclick="open_popup('your_image_path')"
       onclick="LinkButton1_Click"
       runat="Server" />

Open in new window


Your javascript contain
function open_popup(path)
      {
         window.open(path);
      }

Open in new window

0
 
Kiran SonawaneProject LeadCommented:
Remove onclick event from button

<asp:linkbutton id="LinkButton1"
       text="Open Image"
       onclientclick="open_popup('your_image_path')"
       runat="Server" />
0
 
Anurag ThakurTechnical ManagerCommented:
0
 
ASPNET_8Author Commented:
gOOD
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now