3

I'm developing a web application using asp.net. There is a text box which contains a HTML or XML file(loaded from server). After validating the file, I want to store that file where the user wishes to save(client), and the user must save in HTML or XML format only. I had developed a code, but it automatically saves, without asking the user.

 protected void btnsave_Click(object sender, EventArgs e)
    {
        string getnote = txtdisplay.Text.Trim();
        String filepath = Server.MapPath(@"img\new1.txt");
        System.IO.FileStream ab = new System.IO.FileStream(filepath, System.IO.FileMode.Create);
        System.IO.StreamWriter Write101 = new System.IO.StreamWriter(ab);
        Write101.WriteLine(getnote);
        Write101.Close();
    }

Any help is appreciated

T. Stone
  • 19,209
  • 15
  • 69
  • 97
Rayan
  • 63
  • 3

2 Answers2

2

Im providing some links Refer.

  1. Link 1
  2. Link 2
  3. Link 3

Happy Coding..

Community
  • 1
  • 1
Santhosh Nayak
  • 2,312
  • 3
  • 35
  • 65
1

These links might be helpful to you .. Search for Save File Dialog(windows application) equivalent in asp.net/javascript. Refer How can I get the user response regarding SaveFileDialog in Javascript?
and Open File Dialog Asp.Net

Community
  • 1
  • 1
Manoj Nayak
  • 2,449
  • 9
  • 31
  • 53