Error

Discussion in 'ASP.NET / ASP.NET Core' started by garrydawkins, Jan 8, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. [:(!]I have a error from a form that I just cant get rid of. I'm a novice to this areana and any help would be appreciated.
    Control 'Dropdownlist1' of type 'DropDownList' 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 'Dropdownlist1' of type 'DropDownList' must be placed inside a form tag with runat=server.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:


    [HttpException (0x80004005): Control 'Dropdownlist1' of type 'DropDownList' must be placed inside a form tag with runat=server.]
    System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +152
    System.Web.UI.WebControls.DropDownList.AddAttributesToRender(HtmlTextWriter writer) +35
    System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +17
    System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +17
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
    System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72
    System.Web.UI.Control.Render(HtmlTextWriter writer) +7
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
    System.Web.UI.Page.ProcessRequestMain() +1900
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    The error actually spell out the problem.

    In an ASPX page, you would have a form tag and you must place all your control inside the form tag

    For example,

    This will work

    <form runat="server">
    <asp:Label id="lblMessage" runat="server"></asp:Label>
    </form>

    But this won't

    <form runat="server">

    </form>
    <asp:Label id="lblMessage" runat="server"></asp:Label>


    quote:Originally posted by garrydawkins

    [:(!]I have a error from a form that I just cant get rid of. I'm a novice to this areana and any help would be appreciated.
    Control 'Dropdownlist1' of type 'DropDownList' 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 'Dropdownlist1' of type 'DropDownList' must be placed inside a form tag with runat=server.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:


    [HttpException (0x80004005): Control 'Dropdownlist1' of type 'DropDownList' must be placed inside a form tag with runat=server.]
    System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +152
    System.Web.UI.WebControls.DropDownList.AddAttributesToRender(HtmlTextWriter writer) +35
    System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +17
    System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +17
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
    System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72
    System.Web.UI.Control.Render(HtmlTextWriter writer) +7
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
    System.Web.UI.Page.ProcessRequestMain() +1900
    </blockquote id="quote"></font id="quote">
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page