must be placed inside a form tag with runat=server with inheritanc

G

Guest

Hi all,

I have searched this error but none of the posts seem to reflect my situation.

I have a base aspx page that all other pages inherit from. I know than none
of the HTML is inherited only the code behind. I do know under normal
circumstances adding a placeholder resolves this but as UI is not inherited
then I cant use that method.

The base aspx page loads a user control. The user control consists of a
table control (not dynamicly created) which is basically Header Cell, Content
cell and footer cells into which dynamically created controls are added.

The idea is that all pages can inherit from the base page - therefore
providing consistant look and feel also cutting down on each pages
initialisation code.

As soon as a textbox is used I get the above error. If I replace the Textbox
with a label and look at the generated HTML all looks fine

Thanks in advance Pete.
 
G

Guest

some how in your base classs you are specifically telling the designer to
place your controls in within the <form runat="server"> tag. If your going to
be using server controls that cause postback, this is a criteria.
 
S

Steven Cheng[MSFT]

Hi Trinitypete,

I think Tampa's suggestion is reasonable. All the controls that will do
postback or is mapped to html <input > or other elements which will post
form data must be placed inside a html <form> at the client side. The error
you encountered must be caused by some controls is not correctly placed
inside the page's <form>.

Also, if we're doing page inheritance in asp.net1.1, we can put the base
page's html ui in an certain plain text file(for example a "inc" file) ,
then use <!-- include ....> directive to include the content into your
derived page's aspx file. Here is a certain tech article discussing on this:

http://msdn.microsoft.com/library/en-us/dnpatterns/html/ImpPageController.as
p?frame=true

Also, in asp.net2.0, the MASTER PAGE will provide much stronger features on
doing VISUAL page inheritance.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top