I\'m learning MVC and am stumped by this. I\'m trying to factor some common code that gets data and displays it in a WebGrid into a partial view that i can use on multiple pages
The partial page won't pass through a controller, but simply render the view directly. If you want to pass view data to the partial view, there is an overloaded function that takes a viewdata dictionary. I'm sorry I can't be more detailed, but I'm on my mobile (waiting for my son to fall asleep in the other room) :)
Update:
If you want to trigger a GET
action for your partial view, you can use Html.Action
. Here are some useful links:
Further, it would probably make sense for you to move your form tags into your partial view, but those are details for when you clean up the code.