User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,598 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,454 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 489 | Replies: 4
Reply
Join Date: Jul 2007
Location: rohini
Posts: 7
Reputation: coolshail_87 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
coolshail_87 coolshail_87 is offline Offline
Newbie Poster

Question downloading text through asp.net

  #1  
Sep 11th, 2007
hello to all ,i want to attach a text file for downloading the website i am developing through asp.net.........
plz help me in the coding..........
i am sending the coding as below.........

on link button...
Response.AppendHeader("Content-Disposition",Attachment.FileName=TextFile1.txt);
Response.ContentType="Text";
Response.WriteFile("TextFile1.txt");
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Posts: 9
Reputation: rmaheshmsc is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
rmaheshmsc rmaheshmsc is offline Offline
Newbie Poster

Re: downloading text through asp.net

  #2  
Sep 11th, 2007
Hi coolshail...
Try out with this

Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=Text1.txt")
Response.AppendHeader("Content-disposition", "attachment; filename=Text1.txt")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)

It working fine.....
Reply With Quote  
Join Date: Jul 2007
Location: rohini
Posts: 7
Reputation: coolshail_87 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
coolshail_87 coolshail_87 is offline Offline
Newbie Poster

Re: downloading text through asp.net

  #3  
Sep 11th, 2007
thanx sir..........
Reply With Quote  
Join Date: Jul 2007
Location: rohini
Posts: 7
Reputation: coolshail_87 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
coolshail_87 coolshail_87 is offline Offline
Newbie Poster

Solution Re: downloading text through asp.net

  #4  
Sep 11th, 2007
@ rmahesh.............
those coding were working properly.but the problem is wen i click the link button the file poped up to get downloaded or opened is in HTML format and is of 8.01 kb........
is tat the problem of path..........
plz tell me how to gave path of the file to get downloaded.


thanks wid regards.....
Reply With Quote  
Join Date: Jul 2007
Location: rohini
Posts: 7
Reputation: coolshail_87 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
coolshail_87 coolshail_87 is offline Offline
Newbie Poster

Re: downloading text through asp.net

  #5  
Sep 11th, 2007
@ rmahesh.............
those coding were working properly.but the problem is wen i click the link button the file poped up to get downloaded or opened is in HTML format and is of 8.01 kb........
is tat the problem of path..........
plz tell me how to gave path of the file to get downloaded.


thanks wid regards.......
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 6:59 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC