Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you have two forms on a page with ASP.NET MVC?

Using web forms I know that you can only have one ASP.NET form on a page. I've done some implementations where I've used Javascript to add other forms to a page to support things like logon controls (that post back to Logon.aspx instead of the current page). I'm wondering if the single form per page is still present in ASP.NET MVC or if this restriction has been lifted.

like image 395
tvanfosson Avatar asked Dec 13 '25 04:12

tvanfosson


1 Answers

You'll probably want to use regular HTML forms in your MVC code with the action attribute pointing to the appropriate controller action. So you can have as many forms on the page as you want.

like image 70
Gerald Avatar answered Dec 14 '25 18:12

Gerald



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!