hi to all,
I want to give user facility to download files from my website.
so, user first view it. I saved file path in data table, but I don't know how to change href value dynamically..?
or any other solution exist?
hi to all,
I want to give user facility to download files from my website.
so, user first view it. I saved file path in data table, but I don't know how to change href value dynamically..?
or any other solution exist?
If you have the path + name of the file . maybe try the following.
add the path and name to a datatable.
From there you need to get the selected index of the grid row.
Then you get the datarow and the clumns of the row [file path] [file name] and assign it to the item you need ... then on click , response.redirect .
Declare an <a> object in the HTML markup as below. See the runat="server" property. So that you can set/get the properties of <a> object from the C# code behind class file.
<a id="anchDownloadFile" runat="server">Download</a>
You can assign href in the C# class file as below
anchDownloadFile.HRef = "http://localhost/yoursitename/fileName";
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.