M
mugurel
Trying to implement an composite control, I OverRide CreateChildControls(),
where I add my controls, dinamicaly. I try to ad an
System.Web.UI.WebControls.LinkButton Control, and I have the following ,
error :
Control '_ctl0' of type 'LinkButton' must be placed inside a form tag with
runat=server.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.Web.HttpException: Control '_ctl0' of type
'LinkButton' must be placed inside a form tag with runat=server.
Source Error:
Line 52: this.Attributes.Add("onmouseover","(window.status=\'" +
this.ToolTip.Replace("'","\'").Replace("\"","\\\"") + "\'); return true");
Line 53: this.Attributes.Add("onmouseout","(window.status=\'\'); return
true");
Line 54: base.Render(writer);
Line 55: }
Line 56: }
Stack Trace:
[HttpException (0x80004005): Control '_ctl0' of type 'LinkButton' must be
placed inside a form tag with runat=server.]
System.Web.UI.Page.VerifyRenderingInServerForm(Control control)
System.Web.UI.WebControls.LinkButton.AddAttributesToRender(HtmlTextWriter
writer)
System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer)
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
WebControlLibrary.LinkButton.Render(HtmlTextWriter writer) in
C:\Inetpub\wwwroot\CALLCAPTURE\CallCapture.root\CallCapture\WebControlLibrary\LinkButton.cs:54
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
System.Web.UI.Control.Render(HtmlTextWriter writer)
System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer)
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
ASP.WebForm2_aspx.__Render__control1(HtmlTextWriter __output, Control
parameterContainer) in c:\inetpub\wwwroot\CallCapture\WebForm2.aspx:11
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
System.Web.UI.Control.Render(HtmlTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
System.Web.UI.Page.ProcessRequestMain()
It is necesary to set runat attribute to "server", for all controls created
dinamicaly ?
where I add my controls, dinamicaly. I try to ad an
System.Web.UI.WebControls.LinkButton Control, and I have the following ,
error :
Control '_ctl0' of type 'LinkButton' must be placed inside a form tag with
runat=server.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.Web.HttpException: Control '_ctl0' of type
'LinkButton' must be placed inside a form tag with runat=server.
Source Error:
Line 52: this.Attributes.Add("onmouseover","(window.status=\'" +
this.ToolTip.Replace("'","\'").Replace("\"","\\\"") + "\'); return true");
Line 53: this.Attributes.Add("onmouseout","(window.status=\'\'); return
true");
Line 54: base.Render(writer);
Line 55: }
Line 56: }
Stack Trace:
[HttpException (0x80004005): Control '_ctl0' of type 'LinkButton' must be
placed inside a form tag with runat=server.]
System.Web.UI.Page.VerifyRenderingInServerForm(Control control)
System.Web.UI.WebControls.LinkButton.AddAttributesToRender(HtmlTextWriter
writer)
System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer)
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
WebControlLibrary.LinkButton.Render(HtmlTextWriter writer) in
C:\Inetpub\wwwroot\CALLCAPTURE\CallCapture.root\CallCapture\WebControlLibrary\LinkButton.cs:54
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
System.Web.UI.Control.Render(HtmlTextWriter writer)
System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer)
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
ASP.WebForm2_aspx.__Render__control1(HtmlTextWriter __output, Control
parameterContainer) in c:\inetpub\wwwroot\CallCapture\WebForm2.aspx:11
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
System.Web.UI.Control.Render(HtmlTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
System.Web.UI.Page.ProcessRequestMain()
It is necesary to set runat attribute to "server", for all controls created
dinamicaly ?