I need to create a child view that will allow the user to insert related data after selecting a row on the main gridview.
The child view must receive an ID that will indicate which is the parent row.
How can I pass this parameter? ViewBag?
PS: The views and controllers are different and the child view is opened using a Html.ActionLink to the Index action of another controller.
Pass the ID of the parent as a parameter to your action method which invokes the child view.
Replace 364 with the dynamic value from your view
And in your Child Action,Get the Parent object from the ID and show that in child view. Assuming you have a ViewModel liket his for your child view.
Get the Parent details and set the relevant property values in your ViewModel for child view.
Your Child view will be strongly binded to
ChildDetailsclass