Formatting Browse button
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.ClearContent();
response.Clear();
response.ContentType = "text/plain";
response.AddHeader("Content-Disposition", "attachment; filename = " + FileName + ";");
response.TransmitFile(FilePath);
response.Write("This is a test line.");
response.Flush();
response.End();
}
Related Article: Help for printing button & browse button
is a VB.NET discussion thread by BharatBodage that has 5 replies, was last updated 1 year ago and has been tagged with the keywords: &, browse, button, print.
compulove
Junior Poster in Training
68 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Sorry I needed this in code-behind.
compulove
Junior Poster in Training
68 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0