variables from an aspx page are not shared with partial views. A view is simply a representation of a piece of data. You must pass data in the form of a model for each view you want to visualize, whether it is a simple view or a PartialView.
<% Html.RenderPartial("ViewName", Model, ViewDataDictionnary) %>
If you want to pass a variable to a partial view, I highly recommend that you add this parameter to the partial view model, and to pass it additionally through ViewDataDictionnary.
Stéphane Jun 04 '10 at 13:47
source share