Can any one help me with code for download (PPT) document from server using asp.net and c#.??
Thanks in Advance..
Printable View
Can any one help me with code for download (PPT) document from server using asp.net and c#.??
Thanks in Advance..
Thanks for reply...I tried this solution. Its works perfectly.!!!!
If you want to use linkbutton to download the file, please try the following method.
Then you can send the bindary stream based of the CommandName property and CommandArgument property at event RowCommand.Code:<ItemTemplate>
<asp:LinkButton ID="LinkButton1" CommandArgument='<%# Bind("FilePath") %>' CommandName="Select" runat="server">Print</asp:LinkButton>
</ItemTemplate>
Code:protected void dvTest_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Select")
{
string path = e.CommandArgument;
Response.Clear();
Response.ContentType = "application/ms-word";
Response.AddHeader("Content-Disposition", "attachment; filename=test.doc");
Response.TransmitFile(path);
Response.End();
}
}
Hello rnjnagu,
Thanks for posting your solution, I am sure it will help others in the future.
I have edited your above post to include CODE tags, which makes it slightly easier to read :)
Gary
No Probs Gep!!!