views:

139

answers:

1

I have this code:

<div class="LoginBox">
    <form id="form2" runat="server">        
        <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">  
        lolbags          
        </asp:ContentPlaceHolder>       
    </form>
</div>

<form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

        </asp:ContentPlaceHolder>
    </div>
</form>

My plan was to have a form contain my usercontrol LoginBox. The form would be positioned on the top right corner.

I want to have another form for my main content, but it seems you can't have two forms runat-Server.

Am I doing something wrong here?

I'm green to ASP.Net so any help/best practices here will do. :)

+2  A: 

One of the major concepts in ASP.NET (WebForms) is that the entire site is contained within a single form. Whenever a postback is performed, every input on the page is posted. The reason for this is because of ViewState, a hidden form field in ASP.NET WebForms which contains all the state information for every control on the page. This viewstate input needs to be posted on every single postback in order for all the state of the controls to be reloaded properly

LorenVS
Thank you! Apparently my teacher didn't find it important to tell us this. >_>
Sergio Tapia