asp.net - Hyperlink to a text file how to open in webform? -


i have webform , want create hyperlink text file, opens on internet explorer in new window. have added following

<a href="file:///d:/test/test.txt" id="hpltest" runat="server">testhyperlink</a> 

now when click on hyperlink, nothing happening. no error. when open browser , type file:///d:/test/test.txt, file opening.

i appreciate if me out.

you can not give physical path in href file://, give url instead.

<a href="http://www.yourdomain.com/test/test.txt" id="hpltest" runat="server">testhyperlink</a> 

if file within current site use relative path.

<a href="~/test/test.txt" id="hpltest" runat="server">testhyperlink</a> 

the ~ here root path.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -