Calling a different action in MVC3 using Jquery
My application is in Asp.net MVC3 coded in C#.Net, my requirement is,there
is a save to draft button which saves data to a certain table in my
database. I have a print button on the view. I'm using SSRS for printing
my data. When the user fills the form and click save to draft then that
data is saved and then the user can click on Print button to get the SSRS
report of the saved data. My issue is when the user click on print button
then a new tab should open in which reports should be seen.
Below is my View Code
$("#Print_button").live("click", function () {
$('#My_Form').attr('action', 'My Controller action which passes
parameter to
SSRS report');
});
HTML of my Print Button
<input type="submit" id="Print_button" value="Print" />
Controller Code
[HttpPost]
public ActionResult Method_That_Pass_ParameterTo_SSRS(MyClass
Class_Object)
{
My Logic to pass the parameters to SSRS report
return View(Class_Object);
}
My attempts to solve the problem
1. I have tried to add Target="_blank" in the button HTML
2. window.open('MyAction','_blank') in the Jquery Print_Button click event
No comments:
Post a Comment