Hi, using HTML ‘href’ tag and set the property ‘AllowHTML=true’ in the label control or htmlpanel control, we can open any web address, by clicking on the control. Like that, is it possible to open any file from the server?
For example, this is the simple HTML tag : <a href=”C:\Test\Wisej-Readme.pdf” target=”_blank”>File</a>. Since it is a pdf file, it will open in a new tab. Or, if it is other file, it may prompt for download.
I tried by giving the file name with the path to label, linklabel, and htmlpanel controls. Nothing is working.
Is it possible here?
Just I want to display server files either in label or grid with hyperlinks. When the user clicks, either it would open in a separate tab(say if it is pdf) or it would prompt for download. If anybody has a solution, please let me know. It will more useful to me.
You can’t open any file from the server. You can only use a URL address with the browser. The URL is a request that goes to the web server. In order to process the request and return whatever you like you need to use a request handler. This is not a Wisej issue, it’s just the way all browsers and all web servers work.
You can create a custom ASP.NEt ashx handler, or install a IIS handler in web.config, or use a IWisejHandler implementation. It gets trickier with the opening a new tab, vs downloading, etc. We have 4h professional support packages available at sales@wisej.com.
Please login first to submit.