That gets the prevalue for a dropdown that is a Property of the current Model. I need it for the ID of the Datatype not the property of the Model. In the example I put up it is getting the ID (10610) of the custom Datatype itself not the @Model.Property.
How do you get Prevalues from a Datatype using Razor
It used to be so easy to just get your prevalues from a datatype in XSLT. 1 line!!!
What has happened and what is the easiest way to get the prealues from a dropdown list datatype using Razor?
This is my XSLT code, how can I get it in Razor????
<select name="Grades" id="teachersResourceSearchGrade">
<option value="">Choose Grade</option>
<xsl:for-each select="umbraco.library:GetPreValues(10610)//preValue">
<xsl:choose>
<xsl:when test="$resourceGradeType=@id">
<option value="{.}" disabled="false"><xsl:value-of select="." /></option>
</xsl:when>
<xsl:otherwise>
<option value="{.}" disabled="false"><xsl:value-of select="." /></option>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</select>
Hi Carlos,
this can help you:
http://our.umbraco.org/forum/developers/razor/32176-get-prevalue-text-from-dropdown
Sören
@Soren,
That gets the prevalue for a dropdown that is a Property of the current Model. I need it for the ID of the Datatype not the property of the Model. In the example I put up it is getting the ID (10610) of the custom Datatype itself not the @Model.Property.
Thanks though.
is working on a reply...