Solved

ASP.NET DataGrid Button Column vs. HyperLink Column

Posted on 2006-06-21
4
324 Views
Last Modified: 2010-04-16
Hello, I am using an ASP.NET C# DataGrid to display a list of invoices for our customers when they log in. Everything works ok, but it needs some improvement.

First, I used just a Hyperlink Column and, when clicked, it automatically opened up the PDF in a new window.

Next, I changed it to using a command button, that writes out (Response.Write) JavaScript to open up the browser in a new window. I'm not found of the popups that it creates, especially since most people have pop-up blockers. However, this gave me the chance to do some back end programming before displaying the invoice. We need to keep track of who view which invoice and when.

When using a Hyperlink column, I couldn't figure out how to allow me to add a few commands in the code prior to displaying the invoice.

Any suggestions?
0
Comment
Question by:antisoc2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Expert Comment

by:Bowmanje
ID: 16951924
Can you point the link at an intermediary page that will run your code and then redirect to the correct page?  Or better yet, can you have the backend of the pdf page log the necessary information during init?  Then you simply have to pass the necessary information in the url or session variables.

HTH,
Josh
0
 

Author Comment

by:antisoc2
ID: 16951965
I thought about that, and probably will implement that solutions (intermediary page), but I was hoping that .NET gave some other solution.
0
 
LVL 3

Accepted Solution

by:
Bowmanje earned 250 total points
ID: 16952228
Another possibility would be using the ButtonColumn and doing your back-end work then doing a redirect...it doesn't have to be a popup.  You can use the ButtonType to make it a link if you prefer that style.  

There aren't really any command properties that are associated with the HyperlinkColumn.

HTH,
Josh
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

630 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