How to create web part property and pass its value to my user control

I created a normal web part (NOT VISUAL WEB PART) in my sharepoint 2013 environment using visual studio 2012 and C#.

I'm loading a user control inside this web part. I want to create a property in the web part and the property value I want to pass it to the user control. How do I do that.
bujjigaduAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Jamie McAllister MVPConnect With a Mentor SharePoint ConsultantCommented:
Create a web part property like the example here;
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/3aa35b0e-27f9-4dbb-ab8a-2fc1d7435850/custom-web-part-properties-in-visual-studio-2012?forum=sharepointdevelopmentprevious

Create a property on the user control with a scope that makes it visible to the web part, or even in the constructor if possible and appropriate.

Set the user control property when that control is instantiated in the web part.
0
 
bujjigaduAuthor Commented:
Good
0
All Courses

From novice to tech pro — start learning today.