Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Run-time error: <Control Name> must be placed inside a form tag with runat=server

Reply
Thread Tools

Run-time error: <Control Name> must be placed inside a form tag with runat=server

 
 
Matthew Louden
Guest
Posts: n/a
 
      11-18-2003
It happend to me more than once. When I create web controls or move the
positions in VS.NET, I encountered the following run-time errors: It doesn't
matter what controls I create, the following 'checkbox' control is just an
example.


Control 'CheckBox1' of type 'CheckBox' 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 'CheckBox1' of type
'CheckBox' 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.


I know it's very easy to solve the problem, we simply move the code inside
the form block as follows:

<form id="Form1" method="post" runat="server">
'UI code
</form>

Maybe it's bug in VS.NET. I just want to see if anyone encountered similar
problem before.

Please advise. Thanks!




 
Reply With Quote
 
 
 
 
Jim Heavey
Guest
Posts: n/a
 
      11-18-2003
All asp.net controls (i.e "<asp:') where the Runat=Server
must be within the form tag ( and I would guess even
those ASP controls which are not runat server, but not
absolutely sure about that) those asp.n and the form tag
must be runat=server as well.
>-----Original Message-----
>It happend to me more than once. When I create web

controls or move the
>positions in VS.NET, I encountered the following run-

time errors: It doesn't
>matter what controls I create, the following 'checkbox'

control is just an
>example.
>
>
>Control 'CheckBox1' of type 'CheckBox' 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 'CheckBox1' of type
>'CheckBox' 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.
>
>
> I know it's very easy to solve the problem, we simply

move the code inside
>the form block as follows:
>
><form id="Form1" method="post" runat="server">
> 'UI code
></form>
>
>Maybe it's bug in VS.NET. I just want to see if anyone

encountered similar
>problem before.
>
>Please advise. Thanks!
>
>
>
>
>.
>

 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      11-18-2003
It's not a bug, it's a very much designed feature. Certain controls need to
exist inside a server form for them to work properly.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Matthew Louden" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> It happend to me more than once. When I create web controls or move the
> positions in VS.NET, I encountered the following run-time errors: It

doesn't
> matter what controls I create, the following 'checkbox' control is just an
> example.
>
>
> Control 'CheckBox1' of type 'CheckBox' 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 'CheckBox1' of type
> 'CheckBox' 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.
>
>
> I know it's very easy to solve the problem, we simply move the code

inside
> the form block as follows:
>
> <form id="Form1" method="post" runat="server">
> 'UI code
> </form>
>
> Maybe it's bug in VS.NET. I just want to see if anyone encountered similar
> problem before.
>
> Please advise. Thanks!
>
>
>
>



 
Reply With Quote
 
Lloyd Sheen
Guest
Posts: n/a
 
      11-18-2003
I know what you mean. I have had more IDE related problems with things like
this. Everything is ok , move a control and then things are wrong. I think
the IDE is about where VB2 was. Still not totally ready for prime time.

I keep losing toolbar buttons etc. and it is very frustrating.


"Matthew Louden" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> It happend to me more than once. When I create web controls or move the
> positions in VS.NET, I encountered the following run-time errors: It

doesn't
> matter what controls I create, the following 'checkbox' control is just an
> example.
>
>
> Control 'CheckBox1' of type 'CheckBox' 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 'CheckBox1' of type
> 'CheckBox' 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.
>
>
> I know it's very easy to solve the problem, we simply move the code

inside
> the form block as follows:
>
> <form id="Form1" method="post" runat="server">
> 'UI code
> </form>
>
> Maybe it's bug in VS.NET. I just want to see if anyone encountered similar
> problem before.
>
> Please advise. Thanks!
>
>
>
>



 
Reply With Quote
 
Teemu Keiski
Guest
Posts: n/a
 
      11-18-2003
Or with second reading, if the problem is that IDE moves them out of the
form, then it could be a bug.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist


"Teemu Keiski" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> It's not a bug, it's a very much designed feature. Certain controls need

to
> exist inside a server form for them to work properly.
>
> --
> Teemu Keiski
> MCP, Microsoft MVP (ASP.NET), AspInsiders member
> ASP.NET Forum Moderator, AspAlliance Columnist
>
> "Matthew Louden" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > It happend to me more than once. When I create web controls or move the
> > positions in VS.NET, I encountered the following run-time errors: It

> doesn't
> > matter what controls I create, the following 'checkbox' control is just

an
> > example.
> >
> >
> > Control 'CheckBox1' of type 'CheckBox' 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 'CheckBox1' of type
> > 'CheckBox' 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.
> >
> >
> > I know it's very easy to solve the problem, we simply move the code

> inside
> > the form block as follows:
> >
> > <form id="Form1" method="post" runat="server">
> > 'UI code
> > </form>
> >
> > Maybe it's bug in VS.NET. I just want to see if anyone encountered

similar
> > problem before.
> >
> > Please advise. Thanks!
> >
> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
of type 'TextBox' must be placed inside a form tag with runat=serv =?Utf-8?B?QWxpeHggU2tldmluZ3Rvbg==?= ASP .Net 2 04-22-2005 02:15 PM
'DataGridLinkButton' must be placed inside a form tag with runat=server. Sen Mathew via .NET 247 ASP .Net 2 04-07-2005 12:29 PM
Control 'X' of type 'RadioButton' must be placed inside a form tag with runat=server. Tom wilson ASP .Net 7 02-10-2005 06:47 PM
must be placed inside a form tag with runat=server with inheritanc =?Utf-8?B?dHJpbml0eXBldGU=?= ASP .Net 2 12-22-2004 02:59 AM
Control must be placed inside a form tag John ASP .Net 2 11-03-2004 07:58 AM



Advertisments