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");

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.....

@ 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.....

@ 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.......

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.