SqlAutoComplete: display value in partial view (razor)
Hello everyone from a complete n00b! :)
I'm trying to display the value of a datatype SqlAutoComplete in a partial view using razor.
The datatype is set up like this (see image).
Basically, the editors of our website will be able/forced to choose 1 and only 1 item returned from one of our DB (external to Umbraco) as a property of a node.
All works as expected in the content editing inteface.
I'm struggling, however, to display the selected value in a partial view using razor (bear in min I'm a utter n00b!).
For the sake of seeing if I'm able to grab the property value, my code looks like this, so far, in my partial view:
--------------------------
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var servicePropertyValue = CurrentPage.GetPropertyValue("selectService");
var serviceProperty = CurrentPage.selectService;
}
<p>@servicePropertyValue</p>
<p>@serviceProperty</p>
Now, everything seems ok (I can get the property value), but how do I get only the Value of the Item (that's to say the Value="https://some.url.here" , to use as an href?
Have to add. Our environment is Umbraco 6.1.6 and using uComponents 6.0.0, so I should be able to use PropertyEditorValueConverter, but I'm struggling on how to implement it. ^^
SqlAutoComplete: display value in partial view (razor)
Hello everyone from a complete n00b! :)
I'm trying to display the value of a datatype SqlAutoComplete in a partial view using razor.
The datatype is set up like this (see image).
Basically, the editors of our website will be able/forced to choose 1 and only 1 item returned from one of our DB (external to Umbraco) as a property of a node.
All works as expected in the content editing inteface.
I'm struggling, however, to display the selected value in a partial view using razor (bear in min I'm a utter n00b!).
For the sake of seeing if I'm able to grab the property value, my code looks like this, so far, in my partial view:
--------------------------
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ var servicePropertyValue = CurrentPage.GetPropertyValue("selectService"); var serviceProperty = CurrentPage.selectService; } <p>@servicePropertyValue</p> <p>@serviceProperty</p>
--------------------------
Which returns this:
--------------------------
--------------------------
Now, everything seems ok (I can get the property value), but how do I get only the Value of the Item (that's to say the Value="https://some.url.here" , to use as an href?
Any razor help is much appreciated. :)
Have to add. Our environment is Umbraco 6.1.6 and using uComponents 6.0.0, so I should be able to use PropertyEditorValueConverter, but I'm struggling on how to implement it. ^^
is working on a reply...