how to downoad attachment file
-
i need help for hows to download attachment file from gridview???
-
i need help for hows to download attachment file from gridview???
Hi, Please use the below code
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
onrowcommand="GridView1_RowCommand">
<Columns>
asp:TemplateField
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
CommandArgument='<%# Eval("url") %>' CommandName="cmd"><strong class="highlight">Download</strong></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>For handling this on code behind, see the link below: http://www.daniweb.com/web-development/aspnet/threads/282306[^]
-Manognya __________________________________________________ $ God gives what is best.Not what all you wish :)
-
i need help for hows to download attachment file from gridview???
It depends on your program design first. You can issue a postback to the server, and reload the page, while sending the file down to the browser, if the user clicks ok on the download, or you can do it on the client side using javascript, in which the page stays intact, and javascript intializes the download. I use the javascript method now. I see no reason to issue a postback, even if it's async. Javascript window.open(url to file);