0

hi

i am using visual studio 2008 and i want to save a text file in local path so can anyone explain how to open save dialog box in ASP.NET while i click button .please send with example coding


thanks
regards
suresh.S

2
Contributors
3
Replies
6
Views
6 Years
Discussion Span
Last Post by shakeb@techwave
0

What i think you need a download link insted of save dialog box..Because Server never save any thing to client machine directly.
I can be in Window form not in Asp.net...
If you want to save a file on server there is a control named file up-loader..
if i am not wrong..
OR please give full brief of your requirement..
Shakeb Khan

0

hi
now i am explaining my situation .once i submit the button i need to write all the records from gridview to text file .After this textfile need to save depends on user selected path can u tell how can i do ..

thanks

0

I am still not clear but it look like you want to store txt file on User System.i think.
if no then this is the code will help you to store file on Server

tring DirctoryPath = Server.MapPath(FolderName);
                    DirectoryInfo dirinfo = new DirectoryInfo(DirctoryPath);
                    if (!Directory.Exists(DirctoryPath))
                        dirinfo.Create();
                    else
                    {
                        FileInfo TheFile = new FileInfo(DirctoryPath + "\\" + Filename);
                        if (TheFile.Exists)
                            File.Delete(DirctoryPath + "\\" +FileName);
                    } 

 FileUploader.SaveAs(DirctoryPath + "\\" + FileName);
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.