How to post data from user control - asp.net mvc
Currently i am working on project in which login user control is there in master page. earlier i had seperate login.aspx page and was able to call login method of home controller (with acceptverb = post). now we have changed the idea, want to place login control on master page (home page).开发者_Go百科
Now when i click on login button of login control - it calls login method of controller class with acceptver = get. how can i call login method with acceptverb = post?
Is the button within a form? It has to be within a form to do a post...
As Brian said, you should put your form login controls in a form:
<% using (Html.BeginForm("Login", "Home")) { %>
...your form & submit here
<% } %>
精彩评论