I have problem with my web application. I am using MVC3 and not so familiar with it.
I am making functionality for the user to choose application papers to print. I have functions that return stream for the pdf files. But sending data form UI is the trouble. On the page there is button [print] when i push it an UI dialog appears with checkboxes for the user to choose applications. The confirm button should be confirmation on printing.
I am having problem sending data to my controller and return new tab/window with the pdf. I need to send 3 variables to the controller. String that keep info about what to print, id of user and one other variable. I´ve tried AJAX but thats not working. It seems that with AJAX i cannot return pdf in another tab (please correct if i am wrong)
Can someone give me an idea how i can solve this problem? Good solution to send data from dialog window to controller so i can return pdf files in new tab or window.
Edit:
public ActionResult GetApplication(ApplicationData appldata)
{
var application = GetApplicationPapers(appldata.ShowApplOne, appldata.ShowApplTwo); // Applications comes from report server so true or false to determine whether the pdf contains the report or not.
Response.AddHeader("Content-Disposition", "inline; filename=application.pdf");
return new FileStreamResult(application, "application/pdf");
}
This is how its looks like know. Need to get the values from checkboxes from UI dialog to determine what papers are in the stream.
Can we see what the action method in your controller that you are trying to POST to looks like? You could essentially just use a normal ActionLink method such as:
Where the ‘varX’ is the name of your parameters in your action method.