469,950 Members | 1,903 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

multiple forms on one page

I have a simple web user control. I'd like for this form to appear twice
on a single aspx page. How do I get around the problem of having more
than one <form runat=server> tag?

More background: the user control is a login box. For design reasons I
want the box to be available in the header as well as the bottom of the
page.

Thanks,
Pint

Nov 19 '05 #1
3 2762
On Mon, 18 Jul 2005 20:22:37 -0500, Pint <pi******@fpoint.net> wrote:
I have a simple web user control. I'd like for this form to appear twice
on a single aspx page. How do I get around the problem of having more
than one <form runat=server> tag?

More background: the user control is a login box. For design reasons I
want the box to be available in the header as well as the bottom of the
page.

Thanks,
Pint


Don't define the form in your usercontrol; I assume that's what you're
doing. Usually you leave form definition to the page itself, for this
reason.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 19 '05 #2
Craig Deelsnyder wrote:
On Mon, 18 Jul 2005 20:22:37 -0500, Pint <pi******@fpoint.net> wrote:
I have a simple web user control. I'd like for this form to appear
twice on a single aspx page. How do I get around the problem of
having more than one <form runat=server> tag?

More background: the user control is a login box. For design reasons
I want the box to be available in the header as well as the bottom of
the page.

Thanks,
Pint


Don't define the form in your usercontrol; I assume that's what you're
doing. Usually you leave form definition to the page itself, for this
reason.


Thanks for your reply, but this did not address my question.

I understand that using a single form works. What I am trying to learn
is if anyone knows a way to allow for two or more forms on a single aspx
page. One use of this would be to allow a login form on every page, even
pages that have an entirely different form on them.
It would be nice to put the implementation of the login form in a user
control so that it could easily be incorporated into every page. Your
solution does not allow for this abstraction.
Thanks,
Pint
Nov 19 '05 #3
Hi,

You can have multiple runat=server forms in one aspx provided only one is
visible at a time, which thus is not useful for your problem.

I am still confused as to why you require to have form tags in your user
control. You could have the whole login logic in the user control and put
multiple instances of the user control in the same web form, right?

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/

"Pint" wrote:
Craig Deelsnyder wrote:
On Mon, 18 Jul 2005 20:22:37 -0500, Pint <pi******@fpoint.net> wrote:
I have a simple web user control. I'd like for this form to appear
twice on a single aspx page. How do I get around the problem of
having more than one <form runat=server> tag?

More background: the user control is a login box. For design reasons
I want the box to be available in the header as well as the bottom of
the page.

Thanks,
Pint


Don't define the form in your usercontrol; I assume that's what you're
doing. Usually you leave form definition to the page itself, for this
reason.


Thanks for your reply, but this did not address my question.

I understand that using a single form works. What I am trying to learn
is if anyone knows a way to allow for two or more forms on a single aspx
page. One use of this would be to allow a login form on every page, even
pages that have an entirely different form on them.
It would be nice to put the implementation of the login form in a user
control so that it could easily be incorporated into every page. Your
solution does not allow for this abstraction.
Thanks,
Pint

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by James X. Li | last post: by
8 posts views Thread by TJS | last post: by
5 posts views Thread by Alex Maghen | last post: by
3 posts views Thread by Yehia A.Salam | last post: by
1 post views Thread by draw | last post: by
2 posts views Thread by =?Utf-8?B?VGFtbXkgTmVqYWRpYW4=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.