Afternoon, all!

Having a bit of a problem getting my StringWriter to produce a CSV with data in it. I made some changes and added several of the entries from the database per the client. I got the file to create once before I made these changes. There is information in the database to grab. This is probably just my lack of understanding of the StringWriter and how it works. 

```
    public void ExportToCsv()
    {

        DateTime newDate = DateTime.Now.AddMonths(-6);

        StringWriter sw = new StringWriter();

        sw.WriteLine("Name,SS#,Application Date,Company,Job Code,Job Applied For,2nd Choice,3rd Choice,EEO Job Group,Gender,EEO Applicant,Veteran Status,Interview Date Personnel,Interview Date Manager,Reference Date,Physical Date,Disposition,Comments,Job Fair Location");

        Response.ClearContent();
        Response.AddHeader("content-disposition", "attachment;filename=ExportedAAInfo.csv");
        Response.ContentType = "text/csv";

        var q = _db.applicants.Where(n => n.date_applied > newDate && n != null);

        foreach (var item in q)
        {

            string jobGroup = "Test Job";

            sw.WriteLine(string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17},{18}",

                            item.last_name + "," + item.first_name,
                            item.idnumber,
                            String.Format("{0:MM/dd/yyyy}", item.date_applied),
                            item.referral,
                            "",
                            item.job_applied,
                            "Any",
                            "Any",
                            jobGroup,
                            item.gender,
                            item.race,
                            item.veteran_status,
                            item.interview_date,
                            item.interview_manager,
                            item.reference_date,
                            item.physical_date,
                            item.disposition,
                            item.comments,
                            item.job_fair_location
                            ));
        }

        Response.Write(sw.ToString());
        Response.Flush();
        Response.Close();
    }

```

I am properly getting the file download, just nothing in it. Not even the manual WriteLine with the column headers in it. Any points you can see to point me in the right direction would be greatly appreciated!

EDIT:

I have simply narrowed everything down to just trying to print a string into the Response. I am using this little method.

```
        public void ExportToCsv()
    {

        string sw = "Hello, World!";
        Response.Clear();
        Response.ContentType = "text/plain";
        Response.AddHeader("content-disposition", "attachment;filename=ExportedAAInfo.txt");
        Response.Write(sw.ToString());
        Response.End();

    }

```

Ignore the name of the method, its just testing at this point. I am still getting the file download, just nothing printed in the file. 

I am wondering if there is a certain way in which you must call the method for the response to pick it up? 
At the moment i am just using

```
@Html.Action("ExportToCsv")

```

as the href on my button to download. Are there any server settings or anything that I need to look into to keep this from happening? Kinda at a loss as I cant get this simplified method to work either.