mainrotor
asked on
I need help with a link in my MVC.Net application with C#.Net code-behind
Hi Experts,
I have an MVC.Net application that uses C#.Net code behind.
In my views I use a Kendo UI grid. One of the columns in the grid is a link.
When the user clicks on the link it should open a .pdf file. So we need to pass the file path and the file name.
How can I do this?
Thank you,
mrotor
I have an MVC.Net application that uses C#.Net code behind.
In my views I use a Kendo UI grid. One of the columns in the grid is a link.
When the user clicks on the link it should open a .pdf file. So we need to pass the file path and the file name.
How can I do this?
Thank you,
mrotor
ASKER
Craig,
Thanks for the reply. I have to use the URL because the .pdf files are actually stored at a vendors site. Not on our on server.
So we pass the url and append the file name to the url.
I will post a sample of the how it's currently being done in a non-web app.
Thanks,
mrotor
Thanks for the reply. I have to use the URL because the .pdf files are actually stored at a vendors site. Not on our on server.
So we pass the url and append the file name to the url.
I will post a sample of the how it's currently being done in a non-web app.
Thanks,
mrotor
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
However, direct linking to files on your server can be a bit dangerous in cases where the user should only be able to access certain files (e.g. files pertaining only to his or her company or personal business).
I would recommend not including the path on the request as that exposes the structure of your file storage as well. Instead, come up with a convention-based approach for storing the files and only provide the file name to the front-end. Then you simply create a controller action that returns a File.
Open in new window