B
Bei
Now I'm facing a requirement that every users can personalize their
own web parts, and there is a administrator who has rights
1, to publish a 'personalization' of a single web part to all users in
his group.
2, to a 'personalization' of a whole page.
my solution to the first problem is: Add a new class inherits the
webpart class and implements the IPersonalizable Interface and write
code below to personlize:
void IPersonalizable.Load(PersonalizationDictionary state)
{
PersonalizationEntry entry1 = state["someKey"] as
PersonalizationEntry;
if (entry1 != null)
someValue = (someType)entry1 .Value;
PersonalizationEntry entry2 = state["someOtherKey"] as
PersonalizationEntry;
if (entry2 != null)
someOtherValue = (someOtherType)entry2 .Value;
}
void IPersonalizable.Save(PersonalizationDictionary state)
{
PersonalizationEntry entry1= new
PersonalizationEntry(someValue,
PersonalizationScope.Shared);
state.Add("someKey", entry1);
PersonalizationEntry entry2= new
PersonalizationEntry(someOtherValue,
PersonalizationScope.User);
state.Add("someOtherKey", entry2);
}
When loading with the Webpartmange.Personalization.Scope==User, the
entry1 with the scope 'shared' are always null, while the entry2 with
'User' scope are not null. Can any one give me a detail explanation??
I have no idea about publishing the personalization of the who page,
especially how to <b>customizing</b> this.
any helps are appreciated!
own web parts, and there is a administrator who has rights
1, to publish a 'personalization' of a single web part to all users in
his group.
2, to a 'personalization' of a whole page.
my solution to the first problem is: Add a new class inherits the
webpart class and implements the IPersonalizable Interface and write
code below to personlize:
void IPersonalizable.Load(PersonalizationDictionary state)
{
PersonalizationEntry entry1 = state["someKey"] as
PersonalizationEntry;
if (entry1 != null)
someValue = (someType)entry1 .Value;
PersonalizationEntry entry2 = state["someOtherKey"] as
PersonalizationEntry;
if (entry2 != null)
someOtherValue = (someOtherType)entry2 .Value;
}
void IPersonalizable.Save(PersonalizationDictionary state)
{
PersonalizationEntry entry1= new
PersonalizationEntry(someValue,
PersonalizationScope.Shared);
state.Add("someKey", entry1);
PersonalizationEntry entry2= new
PersonalizationEntry(someOtherValue,
PersonalizationScope.User);
state.Add("someOtherKey", entry2);
}
When loading with the Webpartmange.Personalization.Scope==User, the
entry1 with the scope 'shared' are always null, while the entry2 with
'User' scope are not null. Can any one give me a detail explanation??
I have no idea about publishing the personalization of the who page,
especially how to <b>customizing</b> this.
any helps are appreciated!