Solved

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

Posted on 2013-12-10
2
1,086 Views
Last Modified: 2014-01-13
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.
0
Comment
Question by:bujjigadu
2 Comments
 
LVL 31

Accepted Solution

by:
Jamie McAllister MVP earned 500 total points
ID: 39710995
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
 

Author Closing Comment

by:bujjigadu
ID: 39777235
Good
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SharePoint 2013 Blog Template 2 52
What .NET website keeps me current? 9 76
Authentication of Web Services 3 89
Interview questions for support of a legacy ASP.NET site 4 69
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question