[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

unknown

5/25/2007 8:23:00 PM

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


3 Answers

Bora

5/26/2007 2:09:00 AM

0

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" <nospam@nospam.com> wrote in message
news:O$zO$pwnHHA.4220@TK2MSFTNGP04.phx.gbl...
> 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

5/26/2007 5:52:00 AM

0

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


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice....
http://teemu...


"Miguel" <nospam@nospam.com> wrote in message
news:O$zO$pwnHHA.4220@TK2MSFTNGP04.phx.gbl...
> 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
>


Erland Sommarskog

11/17/2013 3:45:00 PM

0

Mark Brader (msb@vex.net) writes:
> Hey, I told you one of them was on Global National!
>

Global National? What a contradictive name!


--
Erland Sommarskog, Stockholm, esquel@sommarskog.se