Tuesday, February 12, 2008

Adding a button on a Sharepoint web part

 

private string MessageButtonTreeClick="";

// Declare variables for HtmlControls user interface elements.
public void mybtnSearch_click (object sender, EventArgs e)
{
    MessageButtonTreeClick += "ButtonClicked";                
}

 

_______________________________________________

// Override the ASP.NET Web.UI.Controls.CreateChildControls

// method to create the objects for the Web Part's controls.

protected override void CreateChildControls ()

{

//Create a Search Button

mybtnSearch = new HtmlButton();

mybtnSearch.InnerText = "Search...";

mybtnSearch.Attributes.Add("width","75px");

mybtnSearch.ServerClick += new EventHandler ( mybtnSearch_click );

myTableCellControls_btnSearch.Controls.Add(mybtnSearch);

}

 

_______________________________________________

public class Tree : Microsoft.SharePoint.WebPartPages.WebPart

{

HtmlButton mybtnSearch ;

}

0 Comments:

Post a Comment

<< Home