P
Praveen Naregal
Hi all,
I am trying to add linkbuttons at run time. Here is the code.
//....
System.Web.UI.WebControls.LinkButton lbAcnt = new
System.Web.UI.WebControls.LinkButton();
Controls.Add(lbAcnt);
lbAcnt.ID = "lButton" ;
lbAcnt.Enabled = true;
lbAcnt.Visible = true;
lbAcnt.Text = "lButton" ;
lbAcnt.Click += new System.EventHandler(this.DisplayAcntDetails);
//..
I am getting the following error.
HttpException (0x80004005): Control 'lButton' of type 'LinkButton' must be
placed inside a form tag with runat=server.]
What is wrong here. How to set these runat = server property at runtime?
Thanks in advance
Praveen Naregal
I am trying to add linkbuttons at run time. Here is the code.
//....
System.Web.UI.WebControls.LinkButton lbAcnt = new
System.Web.UI.WebControls.LinkButton();
Controls.Add(lbAcnt);
lbAcnt.ID = "lButton" ;
lbAcnt.Enabled = true;
lbAcnt.Visible = true;
lbAcnt.Text = "lButton" ;
lbAcnt.Click += new System.EventHandler(this.DisplayAcntDetails);
//..
I am getting the following error.
HttpException (0x80004005): Control 'lButton' of type 'LinkButton' must be
placed inside a form tag with runat=server.]
What is wrong here. How to set these runat = server property at runtime?
Thanks in advance
Praveen Naregal