how to set the title of a webpart without modifying the webpart's property in IE the first time when it is imported and allow user to change the title in IE later by modify the webpart's property. i try many ways, but the below is one of those , please let me know if anyone find a better way
1. Define a Public Property
String WebPartTitle = "WebPlaza Admin"; const string web_part_title = "WebPlaza admin";
///
Set {WebPartTitle = value;}}
2. Override OnPrereder Method
Protected Override Void OnPrender (Eventargs E) {this.title = this.WebPartTitle; Base.onPrender (e); // this.saveproperties = true;
}
3. Override GetToolParts Method
public override ToolPart [] GetToolParts () {ToolPart [] toolparts = new ToolPart [2]; WebPartToolPart wptp = new WebPartToolPart (); CustomPropertyToolPart custom = new CustomPropertyToolPart (); toolparts [0] = wptp;
Hide the default title "; toolparts [1] = Custom; Return Toolparts; Return Toolparts;