4
Reply

How to actionlink pass parameter to controller MVC 5 ?

Mani Kandan

Mani Kandan

Feb 22 2017 5:13 AM
2.3k
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)