2

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

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.