0

I have made a web application that uses master page for Login & Logout operation. For that purpose, I have used LoginStatus control in master page provided by ASP.NET. However, LoginStatus control needs to be used inside <form> tag as

<form id="form1" runat="server">
<asp:LoginStatus ID="LoginStatus1" runat="server" />
</form>

My Content pages has Login control or New User (Signup) control, for logging in or new user creation. These too requires to be enclosed in <form> tag.

So in these pages, there appears to be two ASP.NET forms with runat="server".

  1. Form for LoginStatus in Master page
  2. Form for Login control in Content pages

ASP.NET does not allow to have 2 forms simultaneously. One solution is to make one form hidden, but it cannot be applied in this case.

I tried to enclose entire page within one ASP.NET form tag so that LoginStatus & Login/Signup control comes under a single form tag, but then neither Login nor Signup works, because these controls require for themselves, a seperate form tag.

So how shall I proceed or what changes I need to make both the controls work simultaneously?

1 Answer 1

1

That is a common use case scenario. There must be some thing not quite right with your masterpage/content page setup.

Here is a working project that does what you ask.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.