0

Possible Duplicate:
Multiple forms on ASP.NET page

i have a doubt. can we place more than one form tag in a xxx.aspx page

Community
  • 1
  • 1
Surya sasidhar
  • 29,607
  • 57
  • 139
  • 219

5 Answers5

1

Yes, you can have multiple forms in a page and can set the action of each form to different pages.

<form name="frm1" action="first.aspx"></form>
<form name="frm2" action="second.aspx"></form>
rahul
  • 184,426
  • 49
  • 232
  • 263
1

form tag in a xxx.aspx? It's hard to understand what you're asking.

If you talking about the asp.net form tag, you can have only one per page. If you talking about regular html form tag, you can have how many you want.

Fitzchak Yitzchaki
  • 9,095
  • 12
  • 56
  • 96
1

You can include as many server-side forms as you need in a Web Forms page, as long as you ensure that no more than one is visible at any time. See: http://msdn.microsoft.com/en-in/magazine/cc164151(en-us).aspx

0

Can you? yes, should you? maybe not. It really depends on the point of the page and what its doing,

  • are the two forms entirely separate?
  • do they deal with entirely different entities?

if so then yes you could have two separate forms as long as each form is uniquely identified. Alternatively you could look at having two separate user controls which carry out the required functionality within the one ASPNET form.

Mauro
  • 4,531
  • 3
  • 30
  • 56
0

You cannot have multiple server side form tags. you can use one server side form and multiple html forms in the same page.

In ASP.NET, one page is allowed to contain one form with runat="server" property. Thus, it's impossible to contain multiple server forms in one page.

Brij
  • 6,086
  • 9
  • 41
  • 69