Sometimes we require to pass parameter value from main view to controller and on depend of parameter controller load different data in to the partial view.
Suppose, I create a partial view for Year Control and on year type is different i.e. if year type is 1 then year range will be April to March, if year type is 2 then year range will be January to December.
For doing these, we write the below code in parent view:

Here GetFinyearData is the Action Name and Emporg is the Controller Name.
Then create the partial view:

Below is the Controller code:

Here GetFinyearMonth return the list with Month Name as per finyear type.
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Chandradev PrasadPosted Nov 9, 2014, 3:25 AM
Nice post.