Rowshan Ali

Rowshan Ali

  • NA
  • 64
  • 142.2k

Download .zip file in asp.net

Mar 5 2013 10:41 PM
Hello
dear i am in problem to download .zip file in computer . my recomendation is bellow.

&nbsp;<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            &nbsp;<asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Go" />

<asp:GridView ID="GridView2" runat="server" onrowcommand="GridView1_RowCommand">
                <Columns>
                    <asp:TemplateField HeaderText="Select">
                        <ItemTemplate>
                            <asp:LinkButton ID="hypeno" runat="server"
                                CommandArgument='<% #Bind("zip") %>' CommandName="cmdBind"
                                Text='<%#Eval("zip")%>'>LinkButton
</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>

------------------------
source code
-----------------------
    Premier1888bdDataContext db = new Premier1888bdDataContext();
    protected void Button1_Click(object sender, EventArgs e)
    {
        string a = TextBox1.Text;
        var st1 = from s in db.POInfos where s.PONO == a select s;
        GridView2.DataSource = st1;
        GridView2.DataBind();
         }



    Input pono                          
          

SelectPONOProjectByerNameShipmentDatezip
dragpanel1.zip
20PTLIkei
2/2/2013 12:00:00 AMdragpanel1.zip

When i click the link in grid view this file download in F/ in computer.
my file location is "~/Web/Files/dragpanel1.zip"

If any body help me by giving Source code best regurds. thanks.

Answers (1)