Solved

opening a gridview image in new page

Posted on 2011-09-23
4
157 Views
Last Modified: 2012-05-12
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
Comment
Question by:ASPNET_8
  • 2
4 Comments
 
LVL 17

Expert Comment

by:sonawanekiran
ID: 36586117
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
 
LVL 17

Accepted Solution

by:
sonawanekiran earned 250 total points
ID: 36586121
Remove onclick event from button

<asp:linkbutton id="LinkButton1"
       text="Open Image"
       onclientclick="open_popup('your_image_path')"
       runat="Server" />
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 36586406
0
 

Author Closing Comment

by:ASPNET_8
ID: 36953731
gOOD
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now