Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi All
I have create a property in parent page and a user can add comma separated value in text box. I want to use these comma separated values in a drop down which is in child pages.
Is there any way to achieve this ?
Thanks
Hi Manish
I would use some code like this:
@{ List<SelectListItem> dropdownValues = Model.Content.Parent.GetPropertyValue<string>("commaSeparatedValues").Split(',').Select(x => new SelectListItem() { Text = x, Value = x }).ToList(); } @Html.DropDownListFor(m => m.PropertyName, dropdownValues, "Please Select...")
Thanks Paul
Actually I need to show this drop-down in CMS on child pages how can i achieve this ?
Have a look at the package called NuPickers. I bet there is an option there to base the source of a control on a value from a content item.
Let me try with package. Is there any example/code you used. Please share your exp here.
I've only used the SQL table as a source, so far. But there are other sources you can use. Have a look here to see if you can do what you need to.
https://github.com/uComponents/nuPickers/wiki/Data-Sources
I will check this and let you know here.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Create drop down dynamically in child page
Hi All
I have create a property in parent page and a user can add comma separated value in text box. I want to use these comma separated values in a drop down which is in child pages.
Is there any way to achieve this ?
Thanks
Hi Manish
I would use some code like this:
Thanks Paul
Actually I need to show this drop-down in CMS on child pages how can i achieve this ?
Thanks
Have a look at the package called NuPickers. I bet there is an option there to base the source of a control on a value from a content item.
Let me try with package. Is there any example/code you used. Please share your exp here.
I've only used the SQL table as a source, so far. But there are other sources you can use. Have a look here to see if you can do what you need to.
https://github.com/uComponents/nuPickers/wiki/Data-Sources
I will check this and let you know here.
Thanks Paul
is working on a reply...