I am using an web application asp.net with mvc3. I am new to mvc3. I am having a download button on my webpage. when i am going to click the download button ,I
You can't pass a byte array, you need a Stream. Just pass a stream from your definition:
public FileResult Download(string id) {
string fid = Convert.ToString(id);
var model = service.GetAllDefinitions().First(x => x.ID == id);
var definitionDetails = new StatisticDefinitionModel(model);
var definition = definitionDetails.ToXml;
string fileName = definitionDetails.Name + ".xml";
string contentType = "text/xml";
return File(new MemoryStream(Encoding.Unicode.GetBytes(definition)), contentType, fileName);
}