Hi,
I am scratching my head for my the past 3 weeks on thsi problem but i have got no soultion.Can some one please help me in this.
need to access the personal
property of the webpart set by the user in the Ajax call. I have tried the below approach but
I am unable to retrieve that successfully it is always returning the default
value of the property.
I am pasting the full code and code marked in bold gives me default value instead of getting property
Some one please help
SPLimitedWebPartManager
webPartManger;
using (SPWeb web = ContextUtility.GetRootWeb())
{
webPartManger = web.GetLimitedWebPartManager(PageURL,
System.Web.UI.WebControls.WebParts.PersonalizationScope.User);
}
foreach (
Microsoft.SharePoint.WebPartPages.WebPart wp in
webPartManger.WebParts)
{
if (wp.IsClosed == false && wp.Visible
== true)
{
if (wp.Title != UtilityConstants.SUMMARY_LINK_WEBPART_HIDE_TEXT)
{
if
(wp.GetType().BaseType.Name == UtilityConstants.BASE_TARGETED_WEB_PART_CLASS_NAME)
{
PropertyInfo[]
wpPropertyCollection = wp.GetType().GetProperties(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
foreach (PropertyInfo wpProperty in
wpPropertyCollection)
{
if (wpProperty.Name ==
UtilityConstants.BASETARGETWEBPART_DISPLAY_PROPERTY)
{
object value = (object)wpProperty.GetValue(wp, null);
if (value.ToString() ==
"True")
createXMLNode = true;
else
createXMLNode = false;
break;
}
}
}
else
{
createXMLNode = true;
}
}
}
}