Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • mahesh 12 posts 34 karma points
    Mar 25, 2011 @ 06:09
    mahesh
    0

    get media id from simple media picker in aspx page

    Hi,

     We want to add a media picker in an .aspx page in a custom section. For this we added this line

    <%@ Register Assembly="controls" Namespace="umbraco.uicontrols.TreePicker" TagPrefix="cc1" %>

    <cc1:SimpleMediaPicker ID="DefaultMediaPicker" runat="server">

    </cc1:SimpleMediaPicker>

    And its working fine means we can select the media using this mediapicker in custom section. But in the code behind the DefaultMediaPicker is null.

    We want the media id in the button click. How we get it.Can anyonehelp me on this. 

     

     

  • kows 81 posts 151 karma points c-trib
    Mar 25, 2011 @ 09:05
    kows
    0

    .aspx content seems right,

    did you add a reference in your project to the controls.dll?

    You need to be able to access DefaultMediaPicker.Value to get the id.

    Might wanna check the designer file and see if the control is in there aswell.

    Something like this:

    (   /// <summary>

            /// DefaultMediaPicker control.

            /// </summary>

            /// <remarks>

            /// Auto-generated field.

            /// To modify move field declaration from designer file to code-behind file.

            /// </remarks>

            protected global::umbraco.uicontrols.TreePicker.SimpleMediaPicker DefaultMediaPicker;

    )

Please Sign in or register to post replies

Write your reply to:

Draft