Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SharePoint > SharePoint Development
SharePoint Development Programming and development for SharePoint Portal Server and Windows SharePoint Services
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SharePoint Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 24th, 2007, 08:07 AM
Authorized User
Join Date: Jun 2007
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Issue after downloading file in ASP.NET page

Hi all,

       I am developing a sharepoint site using ASP.NET application.
       In a ASP.NET page, iam downloading file from sqlserver db.
       It works fine in ASP.NET application, but when i put into
       sharepoint, it shows some problem.
       The file gets downloaded but after clocking save,
       open or cancel in save dilogbox,the page shows no response.
       That is, no event has been occured like server button
       click or anything.
       The code i used is:

protected void lnkbtnDownload_Click(object sender, EventArgs e)
        objEmployeeLeave.GetEMPSelectLeaveView(); //To load the file
        string filename = "LeaveAttachDocument";
        string name = "";
        if (objEmployeeLeave.FileAttatchext == ".doc")
            name = filename + ".doc";
        else if (objEmployeeLeave.FileAttatchext == ".txt")
            name = filename + ".txt";


        Response.AddHeader("Content-Disposition", "attachment; filename=" + file);
        Response.AddHeader("Content-Length", file.Length.ToString());
        Response.ContentType = "application/octet-stream";
        //Response.BinaryWrite(objEmployeeLeave.FileAttatch) ;
        Please view the above code and provide solution for this issue.I had searched in many sites.But i havent get clear solution.

Thank You all,
Subhashni Palanivel.

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I execute .exe file from asp.net page suri_thanda ASP.NET 1.0 and 1.1 Professional 4 May 10th, 2005 01:17 AM
Issue of downloading Excel file(resent) zuolinbai Classic ASP Professional 3 June 15th, 2004 11:10 AM
Issue of downloading Excel file(resent) zuolinbai Classic ASP Basics 1 June 10th, 2004 05:24 PM
Issue of downloading Excel file zuolinbai Classic ASP Professional 1 June 7th, 2004 05:50 PM
.NET class file in ASP page shahpragnesh_p VS.NET 2002/2003 1 August 22nd, 2003 10:50 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.