Hi,
I'm tryig to add a LinkButton with events to a custom control (custom
control : Datagrid)
My CreateChildControls is generating an error (Specified cast is not
valid.)
Here is my function:
protected override void CreateChildControls()
{
if(FirstLinkButton==null)
{
FirstLinkButton=new Button();
FirstLinkButton.Text="<<";
FirstLinkButton.CommandName="F*irst";
FirstLinkButton.ID="FirstLinkB*utton";
}
this.FirstLinkButton.Command+= new
CommandEventHandler(this.LinkB*utton_Command);
base.CreateChildControls();
System.Web.UI.HtmlControls.Htm*lTable
htmlTbl=new
System.Web.UI.HtmlControls.Htm*lTable();
System.Web.UI.HtmlControls.Htm*lTableRow
htmlRow=new
System.Web.UI.HtmlControls.Htm*lTableRow();
System.Web.UI.HtmlControls.Htm*lTableCell
htmlCell;
htmlCell=new
System.Web.UI.HtmlControls.Htm*lTableCell();
htmlCell.Controls.Add(FirstLin*kButton);
htmlRow.Controls.Add(htmlCell)*;
htmlTbl.Controls.Add(htmlRow);
this.Controls.Add(htmlTbl);
}
When I remove the function everything is fine. (No error)
What am I missing here?
Thank you,
Doron.