Abhilash J A

Abhilash J A

  • 533
  • 2.4k
  • 597.5k

How to actionlink pass parameter to controller MVC 5 ?

Feb 22 2017 5:13 AM
Hello,
 
How can I pass 'NextPrevious' value to controller?

  Now 'NextPrevious' is getting always null
  1. [HttpPost]  
  2. public ActionResult PremiumUserRegistration(PartnersVM partnersVM,string NextPrevious)    
  3. {    
  4.  if (NextPrevious != null)    
  5.    {   
  6.    }    
  7. }  
View,
  1. @Html.ActionLink("Next >>", "PremiumUserRegistration", "UserRegister", new { NextPrevious = "NextPrevious", @class = "btnActionNext"onclick = "return false;" }) 
And my sript .js file
  1. $('.btnActionNext').click(function () {  
  2.     $(this).closest('form')[0].submit();  
  3. }); 
 Please help me....

Answers (4)