MediaContentSelectorView, how to get results in backend?

Posted by Community Admin on 03-Aug-2018 13:57

MediaContentSelectorView, how to get results in backend?

All Replies

Posted by Community Admin on 07-Feb-2011 00:00

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?

Posted by Community Admin on 07-Feb-2011 00:00

Hi Vitaly,

Please take a look at this post.

Kind regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 07-Feb-2011 00:00

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).

Posted by Community Admin on 07-Feb-2011 00:00

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

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 07-Feb-2011 00:00

Hmm, I'm not really sure how do I set backend property from client script? Could you please provide me with some example code?

Posted by Community Admin on 07-Feb-2011 00:00

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

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 07-Feb-2011 00:00

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.

This thread is closed