Hello. I am new to asp.net though i know php very well, and i watched and read several tutorials but i have a few doubts. I created a layout in XHTML/CSS first of all. Ok, I opened the Visual Studio 2008, created a new asp.net website, copy/pasted my XHTML code in the body tag and css file in the root folder of the website. My layout has in header a searchbox and a loginbox. That means two different forms. And if I put in each form the attribute runat="server" it dies an error. A page can have only one server-side Form tag. If I put runat="server" only at one of the two forms, the other form will not be functional? What should I do? I'm very confused.
Yes, you can not use more than one server side forms in the asp.net. Hence, only the server side form will be posted back to the server and you will not be able to read any values that are present in the other form that is not server side. It is to use only one server side form per asp.net
You should not need 2 forms in asp.net. Just write your code in the click event handler of the buttons. You dont need the forms to post to a different page
but if you have say two forms, lets say one login and one signup.. When the user presses enter (rather then click the button), it will not work properly. So you can use <aspanel runat="server" DefaultButton="Button1"> , which will execute the Button1_Click event when the user presses enter after filling out that form. </aspanel> must be added at the end of that particular form for it to work.