Hi Jerry,
Welcome to the ASPNET newsgroup.
As for how to let our custom webcontrol's string property use the "URL
picker" at design-time(in VS.NET ide), based on my research, we can use the
"EditorAttribute" to apply some certain control editor to our custom
control's string property. There exists some buildin control property
editors in .net framework class library, for example:
UrlEditor, ImageUrlEditor....
Here is simple test control which configure its "Text" propety to use the
"ImageUrlEditor" at design-time in VS.NET ide:
=====================================
[DefaultProperty("Text")]
[ToolboxData("<{0}:TestControl runat=server></{0}:TestControl>")]
public class TestControl : WebControl
{
[Bindable(true)]
[Category("Appearance")]
[DefaultValue("")]
[Localizable(true)]
[ Editor("System.Web.UI.Design.ImageUrlEditor, System.Design,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
typeof(UITypeEditor))]
public string Text
{
get
{
String s = (String)ViewState["Text"];
return ((s == null) ? String.Empty : s);
}
set
{
ViewState["Text"] = value;
}
}
==================================
Hope this helps.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)