User control events

Discussion in 'ASP .Net Building Controls' started by Miguel, May 25, 2007.

  1. Miguel

    Miguel Guest

    Hi
    I have builded some user controls in asp.net and works fine. These contros
    have public properties, that I can view and modify at design time in the
    properties panel. Both, properties and events, have the
    [System.ComponentModel.Browsable(true)] attribute.
    But, the events don't appear in de properties panel.

    Also the [System.ComponentModel.DefaultValue("MyValue")] attribute for the
    properties have not effect and I must assign these values at runtime

    Any Idea?

    best regards
    Miguel
     
    Miguel, May 25, 2007
    #1
    1. Advertising

  2. Miguel

    Bora Guest

    Hi Miguel,

    Just a guess, in propertygrid events are displayed seperately from
    properties (the lightning icon in propertygrid's toolbar). You might be
    missing looking there. If not, would be nice if you send the code you wrote
    for the event.

    In a simple explanation, DevaultValue is used by Visual Studio if to write
    value to aspx page or not. values different than DefaultValue will be
    written to aspx page (which are bold in propertygrid). You should set
    default value by yourself (like below for example.)

    private string myPropertyDefault = "default";
    public string MyProperty
    {
    get
    {
    object o = ViewState["MyProperty"];
    return o==null ? defaultMyProperty : o as string;
    }

    set
    {
    ViewState["MyProperty"] = value;
    }
    }

    Bora
    "Miguel" <> wrote in message
    news:O$zO$...
    > Hi
    > I have builded some user controls in asp.net and works fine. These contros
    > have public properties, that I can view and modify at design time in the
    > properties panel. Both, properties and events, have the
    > [System.ComponentModel.Browsable(true)] attribute.
    > But, the events don't appear in de properties panel.
    >
    > Also the [System.ComponentModel.DefaultValue("MyValue")] attribute for the
    > properties have not effect and I must assign these values at runtime
    >
    > Any Idea?
    >
    > best regards
    > Miguel
    >
     
    Bora, May 26, 2007
    #2
    1. Advertising

  3. Miguel

    Teemu Keiski Guest

    What comes to event's appearance, see this post on Forums
    http://forums.asp.net/t/1111477.aspx


    --
    Teemu Keiski
    AspInsider, ASP.NET MVP
    http://blogs.aspadvice.com/joteke
    http://teemukeiski.net


    "Miguel" <> wrote in message
    news:O$zO$...
    > Hi
    > I have builded some user controls in asp.net and works fine. These contros
    > have public properties, that I can view and modify at design time in the
    > properties panel. Both, properties and events, have the
    > [System.ComponentModel.Browsable(true)] attribute.
    > But, the events don't appear in de properties panel.
    >
    > Also the [System.ComponentModel.DefaultValue("MyValue")] attribute for the
    > properties have not effect and I must assign these values at runtime
    >
    > Any Idea?
    >
    > best regards
    > Miguel
    >
     
    Teemu Keiski, May 26, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sunkam Santhoshi

    Events for menu user control using ie web control

    Sunkam Santhoshi, Dec 16, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    422
    Sunkam Santhoshi
    Dec 16, 2003
  2. Mad Scientist Jr
    Replies:
    0
    Views:
    682
    Mad Scientist Jr
    Mar 22, 2006
  3. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    585
    Jonathan Wood
    Feb 2, 2010
  4. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    426
    Chris
    Aug 30, 2005
  5. Replies:
    1
    Views:
    167
    Peter Michaux
    Apr 27, 2007
Loading...

Share This Page