I have a page (view) called “test.” It has 3 links with a variable”?vars=’some_number'”
How can I pass this number to the controller and based on the number, open up the view that it corresponds to?
I was thinking a case statement in the view, but I am not sure how to get the variable to the controller.
case vars == 1: return("view1");
case vars == 2: return("view2");
case vars == 3: return("view3");
Not sure why you want to do so, but you can have your action like this (assuming you’re in ASP.net MVC)
and the link to this will be YourController/Test/1 or something like this
hope this helps