Nov 12, 2014, 7:08 PM
[CLOSED] File download In MVC
Hi
I am trying to add file download functionality in my application,for that I do bellow code.Its check in Index() function there are download link available or not?If yes then its visible.
I am trying to add file download functionality in my application,for that I do bellow code.Its check in Index() function there are download link available or not?If yes then its visible.
X.LinkButton().Text("Download").ID("UploadPath_1")
public ActionResult Index()
{
if (string.IsNullOrWhiteSpace("Some Path") == true)//Check data base field contains path or not.
{
X.GetCmp<LinkButton>("UploadPath_1").Hide();
}
else
{
//string url = "downloadFile?path=VendorQuotation_Document_1_UploadPath &" + obj_tbl_Pur_Trans_Quotation_Master.QuotationID + "";
X.GetCmp<LinkButton>("UploadPath_1").Show();
X.GetCmp<LinkButton>("UploadPath_1").DirectEvents.Click.Action = "downloadFile";
X.GetCmp<LinkButton>("UploadPath_1").DirectEvents.Click.FormID = "f";
X.GetCmp<LinkButton>("UploadPath_1").DirectEvents.Click.IsUpload = true;
X.GetCmp<LinkButton>("UploadPath_1").DirectEvents.Click.ExtraParams.Add(new Parameter { Name = "path", Value = "VendorQuotation_Document_1_UploadPath" });
X.GetCmp<LinkButton>("UploadPath_1").DirectEvents.Click.ExtraParams.Add(new Parameter { Name = "id", Value = obj_tbl_Pur_Trans_Quotation_Master.QuotationID.ToString(), Mode = ParameterMode.Raw });
}
return View();
}
public void downloadFile(string path, string id)
{
}
after page load downloadFile function not called.
Last edited by Daniil; Nov 18, 2014 at 5:26 PM.
Reason: [CLOSED]