If you just visualize a partial with only a partial name:
@Html.Partial("_SomePartial")
It will actually pass your model as an implicit parameter, just as if you were calling:
@Html.Partial("_SomePartial", Model)
Now, in order for your partial to actually use this, it must also have a certain model, for example:
@model Namespace.To.Your.Model @Html.Action("MemberProfile", "Member", new { id = Model.Id })
Alternatively, if you are dealing with a value that does not apply to your view model (it is in the ViewBag or the value generated in the view itself somehow, then you can pass ViewDataDictionary
@Html.Partial("_SomePartial", new ViewDataDictionary { { "id", someInteger } });
And then:
@Html.Action("MemberProfile", "Member", new { id = ViewData["id"] })
As with the model, Razor implicitly passes your partial ViewData by default, so if you have ViewBag.Id in your view, you can reference the same thing in partial.
Please find the sample code below.
@{ ViewBag.Title = "Index"; string someValue ="abcd"; }
Now pass a string value like this
<h2>Index</h2> @Html.Partial("_MyPartial", someValue)
There is no change in how Partial View consumes your transferred data. As for the partial view, it gets data that you can access through @Model.
Data received is : @Model