tags:

views:

56

answers:

1

In the view

 < % Html.RenderPartial("Sample"); %>

In the partial

<% Html.CustomExtension("samp")%>

in the customextension i'm add some object in ViewData

And i need that same ViewData in View after rendering Partial View.

Becoz of different helper the ViewData is no maintaining...

+3  A: 

To be honest, you ought to approach the problem from the start, rather than trying to bend ViewState to do something it's not supposed to do.

The Partial shouldn't have responsibility for creating anything that the View needs. Can you add the object to the ViewState (or ideally to your ViewModel) somewhere else? In the controller? In the ViewModel itself?

Iain Galloway