Home All Groups Group Topic Archive Search About

Web UserControl (ascx) and UrlProperty attribute

Author
15 Mar 2006 1:44 PM
Mirek Endys
Hello gurus,

i have the problem with web user control. I have there my own property
ImageUrl and want to use standard Url picker in design time.
I tried set UrlProperty attribute there, but it looks like the property in
design time on page has Url Editor (there are three points for opening Url
picker dialog), but it is not working. After clicking on that nothing is
opened.

This is my construction:

[UrlProperty]
public string ImageUrl
{
    get
    {
        string s = (string)ViewState["ImageUrl"];
        return ((s == null) ? String.Empty : s);
    }
    set
    {
        ViewState["ImageUrl"] = value;
    }
}

I tried this one, but it is not working too:
[EditorAttribute(typeof(System.Web.UI.Design.ImageUrlEditor),
typeof(UITypeEditor))]


Thanks for your help

Mirek

Author
16 Mar 2006 6:50 AM
Steven Cheng[MSFT]
Hi Mirek,

Nice to see you again. How are you doing recently, still focus on custom
contro developing?

For the question you mentioned here, do you mean you're trying to use the
"UrlProperty" or "Editor" design-time attributes on an ASCX usercontrol to
provide design-time Url editing functionality? Based on my understanding,
these design-time properties(also the design-time services in IDE) is only
appliable to custom web server control rather than ascx user controls. For
ASCX usercontrols, they're template based, the property and inner control
should be edited inline in the ascx template (or in the aspx page's inline
template).

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Author
17 Mar 2006 11:11 AM
Mirek Endys
Steven,

thanks for help, I have found this information, but thanks for your
neverending patience and your help. My questions must be funny sometimes :)
But, I will send you more questions in future :)

Mirek

Show quoteHide quote
"Steven Cheng[MSFT]" <stch***@online.microsoft.com> wrote in message
news:jfwHAYMSGHA.3492@TK2MSFTNGXA03.phx.gbl...
> Hi Mirek,
>
> Nice to see you again. How are you doing recently, still focus on custom
> contro developing?
>
> For the question you mentioned here, do you mean you're trying to use the
> "UrlProperty" or "Editor" design-time attributes on an ASCX usercontrol to
> provide design-time Url editing functionality? Based on my understanding,
> these design-time properties(also the design-time services in IDE) is only
> appliable to custom web server control rather than ascx user controls. For
> ASCX usercontrols, they're template based, the property and inner control
> should be edited inline in the ascx template (or in the aspx page's inline
> template).
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
Author
20 Mar 2006 1:28 AM
Steven Cheng[MSFT]
Thanks for your followup.

It's my pleasure to be of assistance.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)