chamara
chamara

Reputation: 12711

Pass data from View to Controller

I'm Trying to pass data from view to a controller.

window.location.href = "/DesignCoverSheet/Index?revNumbers=" + revNumber + "&site=" + siteID; 

My problem is, revNumbers parameter consists of comma separated integers that I need to pass to the controller. Sometimes there could be thousands of integer values, so I don't think passing all these parameters in the URL itself is not a good solution. Do I have any other option to achieve this?

Upvotes: 0

Views: 102

Answers (1)

user3804034
user3804034

Reputation:

Convert revNumber to array of integers and post to action and get in your action as below :

public ActionResult YourActionName(int[] revNumbers)

Upvotes: 1

Related Questions