Add the following piece of code (to create the custom property Password for your custom WebPart) in your WebPart class. Now the property will get displayed under Parameters section in the Property panel of the WebPart as displayed in the screenshot below.
private string _strPassword;
[Browsable(true),
Category("Parameters"),
DefaultValue(""),
WebBrowsable(true),
Personalizable(PersonalizationScope.Shared),
WebDisplayName("Password"),
Description("Network Password")]
public string strPassword
{
get
{
return _strPassword;
}
set
{
_strPassword = value;
}
}
Now Access strPassword anywhere in the code to access the value provided by the user.
Great webpart!
ReplyDeleteWhy dont you put it on sale and earn some bucks go to href="http://www.thesharepointmarket.com/submit-product
and start earning!