J
Jim Heavey
I have a Placeholder control. I add a Link Button in code to the place
holder. I set the "ID" value of the LinkButton. When I run, I get the
following error "Control 'lnkItem0' of type 'LinkButton' must be placed
inside a form tag with runat=server".
I do not see a property for "Runat", so I used the Attributes.Add method to
add the Runat="Server", but I get the exact same error. Here is the code..
LinkButton lnk1 = new LinkButton();
lnk1.ID = "lnkItem" + ctr.ToString();
lnk1.Text = "Edit";
lnk1.Attributes.Add("runat","Server");
// Add to the place holder control
plcDataEntry.Controls.Add(lnk1);
// add the event handler
lnk1.Click += new System.EventHandler(this.lnkEditProcesser_Click);
What do I need to do to clear this error?
Thanks in advance for your assistance!!!!!!!!!
holder. I set the "ID" value of the LinkButton. When I run, I get the
following error "Control 'lnkItem0' of type 'LinkButton' must be placed
inside a form tag with runat=server".
I do not see a property for "Runat", so I used the Attributes.Add method to
add the Runat="Server", but I get the exact same error. Here is the code..
LinkButton lnk1 = new LinkButton();
lnk1.ID = "lnkItem" + ctr.ToString();
lnk1.Text = "Edit";
lnk1.Attributes.Add("runat","Server");
// Add to the place holder control
plcDataEntry.Controls.Add(lnk1);
// add the event handler
lnk1.Click += new System.EventHandler(this.lnkEditProcesser_Click);
What do I need to do to clear this error?
Thanks in advance for your assistance!!!!!!!!!