Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 7th, 2004, 03:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default URL Feature

Hello,

I'm coding a control, and I was curious if anybody knew how I could make a property show a browse button, so I can browse in the current project and select a URL, similar to the errorPage property for a web form.

Any ideas, or anybody know where I should start researching?

Thanks,

Brian
__________________
Brian
  #2 (permalink)  
Old June 7th, 2004, 04:30 PM
Imar's Avatar
Wrox Author
Points: 66,617, Level: 100
Points: 66,617, Level: 100 Points: 66,617, Level: 100 Points: 66,617, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,123
Thanks: 65
Thanked 1,386 Times in 1,366 Posts
Default

Hi Brian,

Are you building a Custom / Server control? If so, you can use the EditorAttribute on your property. If you look in the System.Web.UI.Design namespace, you'll see various editors like the ImageUrlEditor (to browse for an image) and the UrlEditor. The following code shows a C# declaration for an ImageURL property:
Code:
    [
    Category("Appearance"), 
    Description("The relative path to an image file within the virtual directory to use for the bars."), 
    EditorAttribute(typeof(System.Web.UI.Design.ImageUrlEditor), typeof(System.Drawing.Design.UITypeEditor))
    ]

    public string BarImage
    // Rest of property here
    When you compile this code, the Property Grid will display a button with ellipses. Once you click it, you'll get a dialog that allows you to select an image. The same applies to the UrlEditor.

Hope this helps,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #3 (permalink)  
Old June 8th, 2004, 07:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Yes, I am developing a custom control. I'll look into that, Thanks for the help. Is there a resource on the web or in the MSDN that has all of the editor types?

Thanks,

Brian
  #4 (permalink)  
Old June 8th, 2004, 07:18 AM
Imar's Avatar
Wrox Author
Points: 66,617, Level: 100
Points: 66,617, Level: 100 Points: 66,617, Level: 100 Points: 66,617, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,123
Thanks: 65
Thanked 1,386 Times in 1,366 Posts
Default

Hi Brian,

I don't know of a definite list with all classes that derive from UITypeEditor, but it's quite possible such an overview exists somewhere.

I have spent some time developing design-time support for custom controls, and I found it very hard to find useful information. However, once you know the terms you need to search for (UITypeEditor, TypeConverter, EditorAttribute, ControlDesigner etc etc) it becomes easier to find snippets of code that are useful.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
URL Redirect based on given URL somnath.kartic VS.NET 2002/2003 1 August 2nd, 2012 08:21 AM
URL rewriting with URL forwarding mtabyana BOOK: Professional Search Engine Optimization with PHP: A Dev's Guide to SEO ISBN: 978-0-470-10092-9 0 October 22nd, 2007 08:22 AM
extract URL from Favorites (.URL Files) PhilHawks VB.NET 2002/2003 Basics 2 November 2nd, 2004 03:35 AM
New Feature Request Ben Horne Forum and Wrox.com Feedback 12 April 28th, 2004 02:37 PM
Another Feature Request Imar Forum and Wrox.com Feedback 0 September 10th, 2003 01:57 PM



All times are GMT -4. The time now is 07:07 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.