MediaContentSelectorView, how to get results in backend?
Hello,
I used MediaContentSelectorView as an image selector:
<sf:MediaContentSelectorView
id="selectorView"
runat="server"
ContentType="Telerik.Sitefinity.Libraries.Model.Image"
ParentType="Telerik.Sitefinity.Libraries.Model.Album"
LibraryBinderServiceUrl="~/Sitefinity/Services/Content/AlbumService.svc/"
MediaContentBinderServiceUrl="~/Sitefinity/Services/Content/ImageService.svc/"
MediaContentItemsListDescriptionTemplate="Telerik.Sitefinity.Resources.Templates.Designers.Libraries.Images.ImageItemDescriptionTemplate.htm"
DisplayResizingOptionsControl="false"
ShowOpenOriginalSizeCheckBox="false">
</sf:MediaContentSelectorView>
How can I restrict selecting one image only and see what this image id is in the backend?
Hi Vitaly,
Please take a look at this post.
Kind regards,
Ivan Dimitrov
the Telerik team
Yeah, I saw it, but it deals with client script and not backend script. Although may be I'm missing something, but I just need id of selected image in the backend (after postback).
Hello Vitaly,
Create a property of your control and set the selected image ID to this property inside the client component.
The build-in selector works with client side API.
Kind regards,
Ivan Dimitrov
the Telerik team
Hmm, I'm not really sure how do I set backend property from client script? Could you please provide me with some example code?
Hello Vitaly,
In your custom class which uses the selector, you can add a public property of type string. Then you can get the property in the designer directly this.get_controlData();
Greetings,
Ivan Dimitrov
the Telerik team
I'm sure what does it have to do with server code though? Can u post a code for this? Basically I have a ASP.NET web page with control, I need to have selected image id in the backend after postback.