4
Answers

How to actionlink pass parameter to controller MVC 5 ?

Mani Kandan

Mani Kandan

7y
2.3k
1
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)