By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 795 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

rrojo

P: n/a
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
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.