SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create an asset picker which matches my needs. I have the asset picker in my Custom Field and i want it to open the dialog from the List he is in.

I wrote down this code:

            urlSelector = new AssetUrlSelector();
            urlSelector.PickerButtonText = "Add";
            urlSelector.AllowExternalUrls = true;

            //Get current list
            string app = this.Context.Request.Url.ToString();
            Match m = Regex.Match(app, @"/Lists/.*/");


            urlSelector.DisplayLookInSection = false;

            //Associate the right path
            urlSelector.DefaultOpenLocationUrl = "~Site" + m.Value;
            urlSelector.DefaultToLastUsedLocation = false;
            urlSelector.AutoPostBack = true;
            this.Controls.Add(urlSelector);

Am i doing something wrong?

share|improve this question
    
Did you ever found a solution? – Steve B Feb 10 '14 at 9:25
    
Sadly not, as I can remember, I change my mind about how the control must be. – Ziba Leah Feb 10 '14 at 12:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.