4
Reply

Displaying PDF document

Chris Gullison

Chris Gullison

Mar 16 2016 9:56 AM
473
Hi there, I am currently working on a project where you can upload and view a PDF document. So far I have the upload PDF function completely working. The only issue I am having is when I click on my View LinkButton I get an error: "Input string was not in a correct format.". I feel as though my LinkButton is properly linked but the error occurs when it hits: 
int id = int.Parse((sender as LinkButton).CommandArgument);
Also, when I use: //var id = ((LinkButton)sender).CommandArgument;    instead, I'm not getting errors, but nothing is showing up.
 
The code for my LinkButton is shown here: 
<asp:LinkButton ID="lnkView" runat="server" Text="View" OnClick="Button2_Click" CommandArgument='<%# Eval("ID") %>'></asp:LinkButton> 
 
Any help would be GREATLY appreciated!

Thanks you,


Answers (4)