开发者

How to post data from user control - asp.net mvc

开发者 https://www.devze.com 2022-12-26 00:15 出处:网络
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 = po

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

精彩评论

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