I am binding one partial view (among 3 views) to the main view.
Main view having model tightly bind with it.
Which partial view is going bind is decided at get method of controller according to the conditions.
Either it bind one of three view or bind none.
From controller I am returning main view with it's model & a string having partial view path.
If string has value i.e. path of partial view then it binds that view.
@if (strPartialPage != null && strPartialPage != "")
{
@Html.Partial(strPartialPage)
}
Every partial view has separate models tightly bind with that view.
How do I pass model to the partial view.
What I have tried:
Firstly I didn't bind model to main view.
I used "Tuple" to pass both models (one for main view & other for partial view) from controller & tightly bind it to Partial view.
But it has disadvantage that I have to bind partial view every time for the condition I don't need it.