// clientjobdescriptionscontroller.cs
[HttpGet]
public void Download(string format, string requests)
{
List<string> req = requests.Split(',').ToList();
foreach (var item in req)
{
RequestController controller = new RequestController();
if (format == "I")
{
Response.Write("rakesh");
controller.DownloadrequirementsInternalUse(Convert.ToInt64(item));
}
if (format == "R")
{
controller.DownloadrequirementsRecruitmentPartner(Convert.ToInt64(item));
}
if (format == "CA")
{
controller.DownloadrequirementsCandidate(Convert.ToInt64(item));
}
if (format == "CR")
{
controller.Downloadrequirementscustomer(Convert.ToInt64(item));
}
}
}
// RequestController
public void DownloadrequirementsInternalUse(long Id)
{
var result = requestService.GetResourceAvailability(Id);
JobDescriptionPdfDownload jobDescriptionPdfDownload = new JobDescriptionPdfDownload();
string strOutput = jobDescriptionPdfDownload.DownloadrequirementsInternalUse(Id);
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=JD-Internal-Use-" + result.RequestCode + ".pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
CreatePdf(strOutput);
}
答案 0 :(得分:0)
Use your action method like this
public ActionResult Download(string format, string requests)
{
}
答案 1 :(得分:0)
尝试在控制器中使用action方法(return actionresult)并尝试使用
return RedirectToAction("DownloadrequirementsInternalUse", "RequestController", new { id=Convert.ToInt64(item) });