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?