开发者

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
<% } %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜