Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SharePoint > SharePoint Development
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 24th, 2007, 08:07 AM
Authorized User
 
Join Date: Jun 2007
Location: , , .
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.Clear();

        Response.AddHeader("Content-Disposition", "attachment; filename=" + file);
        Response.AddHeader("Content-Length", file.Length.ToString());
        Response.ContentType = "application/octet-stream";
        //Response.BinaryWrite(objEmployeeLeave.FileAttatch) ;
        Response.WriteFile(file.FullName);
        Response.End();
}
        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.


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:22 PM.


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