Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: There's an error when running the following code


Message #1 by "thinwolf" <liucb@h...> on Sun, 21 Jul 2002 18:43:34
<html>
<head>
  <title>Holiday page</title>
</head>
<body>
  <form action="holidayresponse.aspx" method="post">
    <h1>Feiertag Holidays</h1>
    Please enter your details here.
    <br /><br />
    Name:<asp:textbox id="FullName" runat="server" />
    <br /><br />
    Address:<asp:textbox id="Address" rows="5" textmode="multiline" 
                         runat="server" />
    <br /><br />
    Sex - 
    <asp:radiobuttonlist id="sex" runat="server">
      <asp:listitem value="Male" />
      <asp:listitem value="Female" />
    </asp:radiobuttonlist>
    Please select the destination you would like details on:
    <asp:dropdownlist id="Destination" runat="server">
      <asp:listitem value="Madrid" />
      <asp:listitem value="Barcelona"/>
      <asp:listitem value="Lisbon"/>
      <asp:listitem value="Oslo"/>
      <asp:listitem value="Prague"/>
    </asp:dropdownlist>
    <br /><br />
      <input type="Submit">
    <input type="Reset">
  </form>  
</body>
</html>


When run, server appears:

Server Error in '/' Application.
--------------------------------------------------------------------------
------

Control 'FullName' of type 'TextBox' 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 'FullName' of 
type 'TextBox' 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 'FullName' of type 'TextBox' must be 
placed inside a form tag with runat=server.]
   System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +151
   System.Web.UI.WebControls.TextBox.AddAttributesToRender(HtmlTextWriter 
writer) +38
   System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter 
writer) +17
   System.Web.UI.WebControls.TextBox.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

 


--------------------------------------------------------------------------
------
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET 
Version:1.0.3705.0 
Message #2 by SANJIB DUTTA <d_sanjib@y...> on Mon, 22 Jul 2002 07:51:50 -0700 (PDT)
hi

change ur form start tag as 
<form action="holidayresponse.aspx" method="post">




<liucb@h...> wrote:
> <html>
> <head>
>   <title>Holiday page</title>
> </head>
> <body>
>   <form action="holidayresponse.aspx" method="post"
runat="server">

thanks 
Sanjib Dutta
>     <h1>Feiertag Holidays</h1>
>     Please enter your details here.
>     <br /><br />
>     Name:<asp:textbox id="FullName" runat="server"
> />
>     <br /><br />
>     Address:<asp:textbox id="Address" rows="5"
> textmode="multiline" 
>                          runat="server" />
>     <br /><br />
>     Sex - 
>     <asp:radiobuttonlist id="sex" runat="server">
>       <asp:listitem value="Male" />
>       <asp:listitem value="Female" />
>     </asp:radiobuttonlist>
>     Please select the destination you would like
> details on:
>     <asp:dropdownlist id="Destination"
> runat="server">
>       <asp:listitem value="Madrid" />
>       <asp:listitem value="Barcelona"/>
>       <asp:listitem value="Lisbon"/>
>       <asp:listitem value="Oslo"/>
>       <asp:listitem value="Prague"/>
>     </asp:dropdownlist>
>     <br /><br />
>       <input type="Submit">
>     <input type="Reset">
>   </form>  
> </body>
> </html>
> 
> 
> When run, server appears:
> 
> Server Error in '/' Application.
>
--------------------------------------------------------------------------
> ------
> 
> Control 'FullName' of type 'TextBox' 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
> 'FullName' of 
> type 'TextBox' 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 'FullName' of
> type 'TextBox' must be 
> placed inside a form tag with runat=server.]
>   
>
System.Web.UI.Page.VerifyRenderingInServerForm(Control
> control) +151
>   
>
System.Web.UI.WebControls.TextBox.AddAttributesToRender(HtmlTextWriter
> 
> writer) +38
>   
>
System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter
> 
> writer) +17
>   
>
System.Web.UI.WebControls.TextBox.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
> 
>  
> 
> 
>
--------------------------------------------------------------------------
> ------
> Version Information: Microsoft .NET Framework
> Version:1.0.3705.0; ASP.NET 
> Version:1.0.3705.0 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

  Return to Index