namespace ListaMen
[DefaultProperty("Text")
ToolboxData("<{0}:Menu runat=server></{0}:Menu>")
XmlRoot(Namespace="ListaMenu")
public class Menu : Microsoft.SharePoint.WebPartPages.WebPar
private Label Label1 = null
public override ToolPart[] GetToolParts(
ToolPart[] toolparts = new ToolPart[2]
WebPartToolPart wptp = new WebPartToolPart()
CustomPropertyToolPart custom = new CustomPropertyToolPart()
toolparts[0] = wptp
toolparts[1] = custom
---------------> toolparts[2] = new ListaMenu.CustomToolPart(); <-------------------------
return toolparts
..............................the rest of webPar
now, i am writting code of ListaMenu.CustomToolPar
using System.Web.UI.WebControls
using Microsoft.SharePoint
using Microsoft.SharePoint.WebPartPages
namespace ListaMen
[ToolboxData("<{0}:CustomToolPart" + "runat=server></{0}:CustomToolPart>")]
public class CustomToolPart: ToolPar
private string inputname
private Label lblUrl = null
private TextBox txtUrl = null;
public CustomToolPart(
this.UseDefaultStyles= true
this.AllowMinimize= false
this.Title = "prueba"
this.Init += new EventHandler(CustomToolPart_Init)
private void CustomToolPart_Init(object sender, System.EventArgs e
inputname = this.UniqueID + "message"
public override void ApplyChanges(
Menu wp1 = (Menu
this.ParentToolPane.SelectedWebPart
wp1.Caption = Page.Request.Form[inputname]
public override void SyncChanges(
// Sync with the new property changes here
/// <summary
/// This method is called by the ToolPane object if the user discards changes to the selected Web Part.
/// </summary
public override void CancelChanges(
protected void CreateToolPaneControls(
this.lblUrl= new Label()
this.txtUrl= new TextBox()
lblUrl.Text="MI PRUEBA"
this.Controls.Add(lblUrl)
this.Controls.Add(txtUrl)
protected override void RenderToolPart(HtmlTextWriter output
this.lblUrl.RenderControl(output)
this.txtUrl.RenderControl(output)
} after, i compile perfectly and i generate el cab
when i do onclick modify the web parts
ERROR