0

Usually in Master page, I put the stuff that I would like to see on all pages, the common stuff, and one of those common stuff are two innocent TextBox with a Button, to be able to log in, that's a Form.

And I have another page, which is the Register page, that's another Form.

I can't use 2 runat="server" forms, so what is the solution for this? The idea that no website written in ASP.NET that has no common log in box in the header can't get into my head...

user1665700
  • 512
  • 2
  • 13
  • 28

1 Answers1

0

Just forget runat='server', back to the html.

Your login form could be

<form action="/loginaction.aspx" method="post">
  <input name="Username" />
  <input name="Password" type="password" />
  <input type="submit" value="sign in" />
</form>

and then put code in the PageLoad method of your loginaction.aspx page to process the login request. It maybe looks like this:

string name = Request["Username"];
string password = Request["Password"];
// do login..

BTW: What a pity that asp.net developer can not work without runat='server' ...

  • But then..what about ASP Validators? – user1665700 Dec 22 '12 at 21:52
  • I'm working on another solution. I will make a Login.aspx page, put the form inside it, then using the jquery .load function to load that page inside a DIV in the master page, maybe it will work. – user1665700 Dec 22 '12 at 21:53
  • @user1665700 Unfortunately, I don't think it will work. You should understand more about the way that how an asp.net page works –  Dec 23 '12 at 00:56