System.Web.HttpException, controls in web

Bizkaitarra

Member
Joined
Feb 8, 2007
Messages
6
Programming Experience
1-3
Hi

My english is not as good as I would like but here is my problem:

I started making my web proyect working with master pages. I had an error when I tried to insert asp controls into an ContentPlaceHolder inside a derivated page. I had thought then to do de proyect without these pages, but the problem stills in normal asp pages.

This is the description of the exception:

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 'Nombre' 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.

And my code is this in the place that is the error:

Fails also if I put the div with runat="server" or without it.
<div id="content" runat="server">

<asp:Label ID="NombreLV" runat="server" Text="Label"></asp:Label>
<asp:TextBox ID="Nombre" runat="server"></asp:TextBox><br />


</div>
 
Asnwer

I have discover the problem....
It seams that you must put all asp forms into a simple htlm form. I was looking for a form of asp but... that was the only problem.
 
Back
Top