I am trying to load an image on the webpage that i have uploaded through the media folder onto the umbraco control. On my webpage i am trying to load it with the following code:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1061: 'Umbraco.Web.Models.RenderModel' does not contain a definition for 'welkomImage' and no extension method 'welkomImage' accepting a first argument of type 'Umbraco.Web.Models.RenderModel' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 15: <div class="inhoudWelkom">
Line 16: @{
Line 17: var mediaPicker = Model.welkomImage; Line 18: if(!String.IsNullOrEmpty(mediaPicker)){
Line 19:
Loading image from umbraco control
I am trying to load an image on the webpage that i have uploaded through the media folder onto the umbraco control. On my webpage i am trying to load it with the following code:
<div class="inhoudWelkom">
<div id="image">@Umbraco.Field("welkomImage")</div>
</div>
all i get in response is a number (1083). Anyone can help me to show the image instead of the number.
You are actually geting the image Id from the Media Folder. If am not mistaken you are using a media Picker here right?
Yes I am using the media picker.
Try this
Getting this error now,
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1061: 'Umbraco.Web.Models.RenderModel' does not contain a definition for 'welkomImage' and no extension method 'welkomImage' accepting a first argument of type 'Umbraco.Web.Models.RenderModel' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 15: <div class="inhoudWelkom"> Line 16: @{ Line 17: var mediaPicker = Model.welkomImage; Line 18: if(!String.IsNullOrEmpty(mediaPicker)){ Line 19:
found the problem, thanks for the code :)
What version of umbraco are you using ?
is working on a reply...