I have code (below) that opens a dialog box to either open or save a file. What I need to do though, is have the file location in the textbox next to it.

Can anyone tell me the code to do that?

protected void Browse_Click(object sender, EventArgs e)
            string FileName = "ExporterOutput.txt";
            string FilePath = "C:/Users/oZ012D/My Documents/ExporterOutput.txt";
            System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
            response.ContentType = "text/plain";
            response.AddHeader("Content-Disposition", "attachment; filename = " + FileName + ";");
            response.Write("This is a test line.");


Private Sub opendialog_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles opendialog.FileOk
        filenamefield.Text = opendialog.FileName
    End Sub

opendialog = The file dialog
filenamefield = The textbox next to the button

Sorry I needed this in code-behind.

oh... can't help you there. Have fun.

Be a part of the DaniWeb community

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