Connecting Tech Pros Worldwide Help | Site Map

How to set the Description of a property in a custom server control

Newbie
 
Join Date: Jul 2009
Posts: 9
#1: Sep 2 '09
Hi, I have created a custom Server Control and I want to add a description to the properties and events that the control holds. I have looked over the Internet and came up with the following...

Code:
<Description("Gets/Set somthing for the property")>_
public property Somthing() as Boolean
Get
end get
Set
end set
End property

Unfortunately this does not seem to work in visual studio .net 2008.

I am not sure if i am missing somthing off can anyone help

Thanks in advanvce

altaafhussein
tlhintoq's Avatar
Moderator
 
Join Date: Mar 2008
Location: Arizona, USA
Posts: 1,743
#2: Sep 2 '09

re: How to set the Description of a property in a custom server control


Here's a working one from live code that I use (though it is C#)
It has description as well as several other properties

Expand|Select|Wrap|Line Numbers
  1.         [Category("CustomValues"),
  2.         Browsable(true),
  3.         ReadOnly(false),
  4.         Bindable(false),
  5.         DefaultValue(5000), /* DefaultValue is only for Designer. Does not actually set value of property.*/
  6.         DesignOnly(false),
  7.         Description("UDP port for the client")]
  8.         public int ClientPort
  9.         {
  10.             get { return (int)nudListeningPort.Value; }
  11.             set { nudListeningPort.Value = (decimal)value; }
  12.         }
  13.  
  14.  
  15.  
Reply

Tags
.net, asp.net, vb.net