And it have also made the necessary changes in config file for the MVC.
Steps that I followed
Step 1
I went to the developer section and added a custom datatypes called "cleaningtypes" with the property editor set to "Multiple Textstring".
Step 2
I then went into Document Types and then added a new Document Type named "cleaning" and then went on to create a property named "text" with type set as "cleaningtypes"
Step 3
I then went into Content and then added had some values into the fields that I have created.
Step 4
Under the Templates section I went to the "cleaning" template added the following code to check if would receive the values that I just added.
@Umbraco.Field("text")
Step 5
And it works as I expected. I get all the values that I inserted.
Step 6
Now I wanted to bind these values into a dropdown list. So i edited the code with the following statments.
<select>
@foreach (var item in Model.text){
<option>@item.InnerText</option>
}
</select>
Step 7
And when I run the website, I get an error.
I look forward for your valuable help and suggestions.
Bind values to dropdown list using razor syntax
My Development Enviorment
Using Umbraco : Version 6.1.5
MVC with Razor
And it have also made the necessary changes in config file for the MVC.
Steps that I followed
Hi Libin, I think you have posted the perfect description!
I think you only need to change your foreach to:
Jeavon
is working on a reply...