locked
want to pass value from view to controller RRS feed

  • Question

  • User1694748171 posted

    I tried to pass value from view to controller using @html.ActionLink but the value never passed 

    this is my view 

       @Html.ActionLink("Show Result", "showResultOption", "Student_Exam", new { @class = "btn btn-primary" , res = "1"})

    this is my controller 

          public ActionResult showResultOption(Student_Exam_ViewModel[] model , string res)
            {
                if(res == "1")
                {
                    return RedirectToAction("GetTestResult", "Student_Exam");
                }
    
          );
     
    
                return View(model);
            }

    but the value string res always null ?

    Wednesday, March 10, 2021 9:11 PM

Answers

All replies