Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / November 2006

Tip: Looking for answers? Try searching our database.

URL Picker in VS 2005 Property Window

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
steve_barker333@hotmail.com - 25 Oct 2006 21:04 GMT
Hi guys!

I'm sure this is an easy question to answer, and I'm equally sure that
the solution involves designer attributes, but I can't seem to find the
correct attribute to use!

Here goes...

You know the Image control in ASP.NET? When you draw an instance on a
web form, and click in ImageUrl in the property window, you get the
"..." button and nice file browser window to help you find the Url. How
do I replicate this behaviour in my custom controls?

Many thanks in advance!

Steve.
Steve C. Orr [MVP, MCSD] - 26 Oct 2006 06:19 GMT
You do it like this:

[Editor(typeof(System.Web.UI.Design.ImageUrlEditor),
typeof(System.Drawing.Design.UITypeEditor))]
   public virtual string MyImageUrl
   {
     get
     {
       ...
     }
     set
     {
       ...
     }
   }

Here's more info and a more detailed example:
http://SteveOrr.net/articles/InheritAndExtend.aspx

Signature

I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net

> Hi guys!
>
[quoted text clipped - 12 lines]
>
> Steve.
steve_barker333@hotmail.com - 02 Nov 2006 01:21 GMT
Hi Steve!

Thanks for your help!

Your code works fine when you view the UserControl in it's own
designer, but when you put the UserControl on a web-form, the
properties are not working correctly. Have I missed something?!

Cheers,

Steve.

> You do it like this:
>
[quoted text clipped - 37 lines]
> >
> > Steve.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.