.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Create Properties important in web part for different control

Posted By:Sagar Pardeshi       Posted Date: September 21, 2013    Points: 40    Category: SharePoint    URL: http://www.dotnetspark.com  

Create Custom WebPart property
 

1.TextBox

 

[Browsable(true),Category ("Miscellaneous"),DefaultValue ("ListName"),

WebPartStorage(Storage.Personal),

Friendly Name("ListName"),Description("Text Property")]

Public string ListName

{

   get

{   

Return  strList;

}

Set

{

strList=Value;

}

}

2.CheckBox

[Browsable(true),Category ("Miscellaneous"),DefaultValue (false),

WebPartStorage(Storage.Personal),

Friendly Name("NeedCheckBox"),Description("Checkbox Property")]

Public bool NeedCheckBox

{

   get

{   

Return  boolCheckBox;

}

Set

{

boolCheckBox =Value;

}

}

3.RadioButton

[Browsable(true),Category ("Miscellaneous"),DefaultValue (true),

WebPartStorage(Storage.Personal),

Friendly Name("NeedRadioButton"),Description("RadioButton Property")]

Public bool NeedRadioButton

{

   get

{   

Return  boolRadioButton;

}

Set

{

boolRadioButton;=Value;

}

}

 



     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend