Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Persist Tool Part Values

  Asked By: Clem Smith         Date: Jul 30, 2010      Category: Sharepoint      Views: 2044

Is there any way to have a tool part persist it's values from session to session?
I have tried overriding the SyncChanges method to no avail.
public override void SyncChanges()
{
this.EnsureChildControls();
SLIVersionHistoryView webPartToEdit = (SLIVersionHistoryView)this.WebPartToEdit;
if (webPartToEdit != null)
{
Comment.Text = wp1.HostString;
ddl.SelectedIndex = ddl.Items.IndexOf(ddl.Items.FindByValue(webPartToEdit.HostString));
}
}

This does not work.
Any ideas on the correct means to accomplish this?

Tagged:        

 

1 Answer Found

 
Answer #1       Answered By: Vladi Gubler          Answered On: Aug 02, 2010       

Your code is not clear, what is this wp1 object? SyncChanged is used to load the property values  from the web part  to the tool  part, it is called when you open the toolpane the first time, if you need to postback while inside the toolpane, say reload some ddl as a response to another ddl you should rely on viewstate as you would in any ASP.NET app.

 
Didn't find what you were looking for? Find more on Persist Tool Part Values Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].