Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2004, 03:39 PM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old June 7th, 2004, 04:30 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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.
 
Old June 8th, 2004, 07:03 AM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old June 8th, 2004, 07:18 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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.





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 04: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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.