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

June 7th, 2004, 03:39 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
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
|
|

June 7th, 2004, 04:30 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

June 8th, 2004, 07:03 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
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
|
|

June 8th, 2004, 07:18 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|
 |