If I understand right you have a link to a .txt file and you want the file
to open in Notepad rather than the browser. To do that the text file needs
to be sent to the browser with a Content-Disposition: Attachment HTTP
header, like this:
Content-Disposition: Attachment; filename="YourTextFilename.txt"
To send an HTTP header you'll have to generate the text file on demand. So
for example, create a "downloadtextfile.aspx" file that you pass a filename
to (downloadtextfile.aspx?filename=YourTextFilename.t xt), and the OnLoad
handler does something like this:
Response.ContentType = "text/plain";
Response.AppendHeader("content-disposition", "attachment; filename=\"" +
Request.QueryString["filename"] + "\"");
Response.Write( /* file contents go here */ );
Nate Hekman
"RNDAS" <> wrote in message
news:%...
> Hi,
> I have a DataGrid in my web page and there is a column in that
> grid which template column with linkButton. When Clicked the
> linkButton it should not refresh the page, rather it should open a
> file in notepad. I am not able to resolve it. Can you please help
> me with code how to do it? I have spent days after days seraching
> Web, books with no luck. I am a newbie in .net.
>
> Thanks a lot
> Hope someone would be kind enough to provide me a solution.
>
> Das
> --
> POST BY: http://www.dotNET.us - Need .NET? Just ask, Please dotNET.us