Multiple ASP.NET Forms within the same page

J

Jason

Hello,

I am converting an old ASP website to ASP.Net and I am running into a
problem.

I have created a header control that I am loading on every page. This
control is gathering some information and displaying it on the screen.
There is also a drop down that is populated if they have access to more than
one profile and they can switch between them.

The problem is, that when I add the control to a new page, that I need to do
some sort of form submission on, it is not possible. It tells me that "A
page can have only one server-side Form tag".

Any help would be greatly appreciated.

Thanks in advance,

Jason
 
K

Karl Seguin

Why not just place a single server side form?

<form id="form1" runat="server">
<uc1:header id="header" runat="server" />
Welcome
</form>

there's no reason for your header user control to have a form tag, simply
have a button in there and handle it's onClick event.

Karl
 
K

Kevin Spencer

The header control should not contain a form. It should be placed in your
WebForm, just as all the other controls in your page, and should
interoperate with it, just as all the other controls in your page.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Big things are made up of
lots of little things.
 

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

Top