Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP.NET DataGrid Button Column vs. HyperLink Column

Posted on 2006-06-21
4
Medium Priority
?
333 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 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

670 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