Click here to Skip to main content
15,884,298 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Img Collection Pin
Vincent Maverick Durano12-Jun-18 20:47
professionalVincent Maverick Durano12-Jun-18 20:47 
AnswerRe: Img Collection Pin
User 418025414-Jun-18 7:05
User 418025414-Jun-18 7:05 
QuestionHow do I control the specflow execution sequence Pin
Ger Hayden4-Jun-18 23:18
Ger Hayden4-Jun-18 23:18 
QuestionInsuring that an application does not maintain a valid state on initialization or shutdown failure. Pin
Stephen Holdorf4-Jun-18 8:45
Stephen Holdorf4-Jun-18 8:45 
AnswerRe: Insuring that an application does not maintain a valid state on initialization or shutdown failure. Pin
Stephen Holdorf5-Jun-18 0:52
Stephen Holdorf5-Jun-18 0:52 
AnswerRe: Insuring that an application does not maintain a valid state on initialization or shutdown failure. Pin
Nathan Minier5-Jun-18 1:43
professionalNathan Minier5-Jun-18 1:43 
QuestionCreate a text file in client machine using asp.net Pin
raj.sibin3-Jun-18 19:02
raj.sibin3-Jun-18 19:02 
AnswerRe: Create a text file in client machine using asp.net Pin
Richard Deeming4-Jun-18 1:28
mveRichard Deeming4-Jun-18 1:28 
Your code-behind runs on the server. It has no access to the client's file system.

The only way you can "create" a file on the client's computer is to write it to the response with the appropriate headers. The user will then be able to save the file wherever they want. They will also be able to choose not to save the file.

And to pre-empt your next question: no, you can't force them to save the file, and you can't influence where the file is saved. You can provide a default file name, but it's only a suggestion, and the user is free to change it.
C#
Response.ContentType = "text/plain";
Response.AppendHeader("Content-Disposition", "attachment;filename=TheSuggestedFileName.txt");

string sourcePath = Server.MapPath("~/path/to/the/file.txt");
Response.TransmitFile(sourcePath);
Response.End();




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

QuestionCode saved to a TFS workspace getting removed on next get latest workspace. Pin
Stephen Holdorf27-May-18 15:13
Stephen Holdorf27-May-18 15:13 
QuestionMiniblog and some of the technology he wrote question Pin
jkirkerx27-May-18 9:23
professionaljkirkerx27-May-18 9:23 
QuestionGrouping Items of this same Category Pin
Otekpo Emmanuel25-May-18 23:11
Otekpo Emmanuel25-May-18 23:11 
AnswerRe: Grouping Items of this same Category Pin
Richard MacCutchan26-May-18 2:43
mveRichard MacCutchan26-May-18 2:43 
GeneralRe: Grouping Items of this same Category Pin
Hariharan Baskaran26-May-18 3:50
Hariharan Baskaran26-May-18 3:50 
GeneralRe: Grouping Items of this same Category Pin
Richard MacCutchan26-May-18 4:39
mveRichard MacCutchan26-May-18 4:39 
QuestionASP MVC Solution projects and 3rd party dll's missing from TFS new branch download. Pin
Stephen Holdorf24-May-18 14:38
Stephen Holdorf24-May-18 14:38 
AnswerRe: ASP MVC Solution projects and 3rd party dll's missing from TFS new branch download. Pin
F-ES Sitecore25-May-18 3:58
professionalF-ES Sitecore25-May-18 3:58 
GeneralRe: ASP MVC Solution projects and 3rd party dll's missing from TFS new branch download. Pin
Stephen Holdorf25-May-18 13:57
Stephen Holdorf25-May-18 13:57 
GeneralRe: ASP MVC Solution projects and 3rd party dll's missing from TFS new branch download. Pin
F-ES Sitecore28-May-18 22:17
professionalF-ES Sitecore28-May-18 22:17 
QuestionBlog for MVC Pin
jkirkerx24-May-18 9:57
professionaljkirkerx24-May-18 9:57 
AnswerRe: Blog for MVC Pin
Richard Deeming25-May-18 2:38
mveRichard Deeming25-May-18 2:38 
GeneralRe: Blog for MVC Pin
jkirkerx25-May-18 8:46
professionaljkirkerx25-May-18 8:46 
QuestionWeb API: What is refresh token Pin
Mou_kol23-May-18 10:04
Mou_kol23-May-18 10:04 
AnswerRe: Web API: What is refresh token Pin
jkirkerx23-May-18 13:22
professionaljkirkerx23-May-18 13:22 
GeneralRe: Web API: What is refresh token Pin
Mou_kol24-May-18 12:48
Mou_kol24-May-18 12:48 
GeneralRe: Web API: What is refresh token Pin
Mycroft Holmes24-May-18 13:01
professionalMycroft Holmes24-May-18 13:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.