What i am thinking is ViewData might be different in the second time you call the partial view. First time you create a view data object and pass it to the partial view and try passing the same view data to the partial view, it is getting lost.
Simple test to verify this
In you partial view just print "ViewData.GetHashCode()" and see if the hash code is the same when inside the partial view while render at location A and B
Cheers,
Gopakumar
| Please click “Mark as Answer” on the post(s) if it helps |
gopakumar.r
Participant
959 Points
193 Posts
Re: MVC3 Razor - @Html.Partial getting called but if it renders is based upon location
May 10, 2012 12:43 PM|LINK
What i am thinking is ViewData might be different in the second time you call the partial view. First time you create a view data object and pass it to the partial view and try passing the same view data to the partial view, it is getting lost.
Simple test to verify this
In you partial view just print "ViewData.GetHashCode()" and see if the hash code is the same when inside the partial view while render at location A and B
Gopakumar
| Please click “Mark as Answer” on the post(s) if it helps |