URL Picker in VS 2005 Property Window

S

steve_barker333

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

steve_barker333

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:

[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

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



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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top