Michael,
I am assuming you are using the dynamic loading of the
form. This is where you add controls from the code. If
not completely ignore this post because it will confuse
you and go with the suggestion of Jos.
You should put a panel inside the <form></form> and add
all of your components to it. That way you can assure
that your components are added in the correct location.
Another suggestion (not sure if this one will work, but I
am assuming it will) would be to name your form tag and
add your items to the form tag. This again will assure
that you have you items added inside your form tags.
Something else to consider, You don't have to load these
controls dynamically. You can actually set their
visibility to true or false depending on if you would
like to display them.
I have no proof of this, but I think the dynamic loading
will be quicker because you are not loading all of the
objects every time you load the page. You are only
loading those that you specify based on if the user is
logged in or not.
There is a great example of this in the IBuySpy portal at
http://www.asp.net/Default.aspx?tabindex=5&tabid=42.
This has also evolved into
http://dotnetnuke.com
Keith
-----Original Message-----
Thank you for any help you can provide.
This is what I have:
index.aspx - contains nothing but a form with runat =
serverheader.ascx - contains asp image box
welcome.ascx - contains text
footer.ascx - contains text
login.ascx - contains asp/web labels and text boxes.
The index page is simply a container for all the user
controls. Theheader, footer, and welcome controls are always
included. The logincontrol should only be included if the user has not
logged in.
Everything runs perfectly if the login control in not
included. Whenthe login control is included I get an error saying that
the control_ctl1_txtUser must reside between the form tags with
runat set toserver. The actual control name is txtUser. I
understand why thename changes. What I don't understand is why it has to
be in the formtag. While investigating, I have read in other threads
that controlson user controls are rendered between the form tags of
the parentobject. Can anyone offer any suggestions?
.