hello.
well, put your treeview inside a webpart control and implement the
IPersonalizable interface (hope the name hasn't changed since beta2).
the easiest way to do this is to put the tree view inside a user
control. here's a quick example that uses a suer control to maintain
the value of a radio button:
<%@
Control Language="C#" ClassName="RadioButtonWebPart" %>
<%@
Import Namespace="System.Web.UI.WebControls.WebParts" %>
<%@
Implements
Interface="System.Web.UI.WebControls.WebParts.IPersonalizable"
%>
<script
runat="server">
private bool _isDirty = false;
public void Load( PersonalizationDictionary
dic ) {
PersonalizationEntry
entry = dic["Sex"];
if( entry != null ) {
sex.SelectedValue = (string)entry.Value;
}
}
public void Save( PersonalizationDictionary
dic ) {
dic ["Sex"] = new PersonalizationEntry(
sex.SelectedValue,
PersonalizationScope.User );
}
public bool IsDirty {
get{ return _isDirty; }
}
void ProcessChanged( object sender, EventArgs
args ) {
_isDirty = true;
}
</script>
Sexo:
<asp:RadioButtonList
runat="server" ID="sex"
OnSelectedIndexChanged="ProcessChanged">
<asp:ListItem Text="Masc"
Value="M" />
<asp:ListItem Text="Fem"
Value="F" />
</asp:RadioButtonList>
--
Regards,
Luis Abreu
email: labreu_at_gmail.com
PT blog: http://weblogs.pontonetpt.com/luisabreu
EN blog:http://msmvps.com/blogs/luisabreu
http://www.pontonetpt.com
http://weblogs.pontonetpt.com/