Nepethya Rana

Nepethya Rana

  • NA
  • 335
  • 151.6k

How do i modify the application so that it download the file

Nov 22 2017 10:52 AM
I am working on old asp.net web form application which opens the file on button click.
I need to modify the application so that it download the file instead of opening the file.
How do i do it?
Code behind :
on page load event :
btnAdvertising.OnClientClick = "javascript:window.open('" & My.Settings.FilePath & "');"
btnAdvertising.DataBind()
In my config file I have passed physical filepath:
<setting name="MAG_URL" serializeAs="String">
<value>file://NetworkDrvie/SHARED/AllPdf/Advertising.pdf</value>
</setting>

Answers (1)