Forms in MasterPage and Views

I have a master page which all my views inherit from. The issue I am having is with the form tag which is created in the master page and then the form tag which is created in view.

Because of the form being inside the master page form, all my postbacks are sent to the controllers Index method and its forcing me to create a new method Index which forces an HttpPost.

Further this is causing problems with routes like: /projects/add/ and /projects/delete/1 where everything is router to the Index Method.

WTF? Am i missing something here?

Thanks anyone


Remove the form from the master page.

Check some sample videos here to better understand the MVC philosophy.

BTW: In ASP.NET MVC, there is no postback.

In my opinion you really ought to think of MasterPages as layouts and not as functional pages. In fact views do not "inherit" from master pages at all. In traditional Webforms, masterpages are in fact user controls. So I would try to not put base-class functionality into a masterpage. So perhaps that is where some of the confusion comes in.

Need Your Help

Search through the array in the searchbar

ios objective-c arrays xcode search

I took advantage of this article to create a search in my application. Slightly changed the code for yourself. But if I add to the array of multiple values (1-5), the search is working perfectly, b...

Comparing date ranges

sql mysql date

In MySQL, If I have a list of date ranges (range-start and range-end). e.g.