Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass ViewDataDictionary to the partial view #67

Merged
merged 1 commit into from Jul 16, 2016

Conversation

Albert0617
Copy link
Contributor

For some cases, we need to pass ViewDataDictionary to the partial view for the dropdownlist control

For example:
Edit view:

@Html.CollectionEditorFor(model => model.RecordsSet, "Editors/_RecordsSetEditor", "/CustomersSets/GetRecordsSetEditor",
"Add Record", new { @Class = "btn btn-default" }, new ViewDataDictionary { { "MyList", ViewBag.MyList } })

partial view:
@Html.DropDownListFor(m => m.rId, (SelectList)ViewData["MyList"], htmlAttributes: new { @Class = "form-control" })

@RicoSuter RicoSuter merged commit ad228e9 into RicoSuter:master Jul 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants