javascript - Call to two buttons from the same page is not working -
javascript - Call to two buttons from the same page is not working -
i have mvc5 application table , when click on create navigates new page form set info , save. working fine, problem need add together additional button calls new action not navigate other page, phone call , response.
when set next 2 buttons in different pages both of them work fine, when add together them same page sec button calls create action of first.
how avoid ?
this save button phone call create action
<div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" id="actbtn" value="create" /> </div> </div>
this sec button works fine in different page , when re-create create page calls create action. know because of submit how should avoid it?
@using (html.beginform("check", "user", new { name = model.name })) { <input type="submit" id="btn" value="check" /> <span id='result'></span> }
how should phone call action check in controller user?
this need do..
@using (html.beginform("yoursaveactionname", "user", formmethod.post, new { enctype = "multipart/form-data" })) { <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" id="actbtn" value="create" /> </div> </div> } @using (html.beginform("check", "user", new { name = model.name })) { <input type="submit" id="btn" value="check" /> <span id='result'></span> }
javascript jquery asp.net asp.net-mvc asp.net-mvc-4
Comments
Post a Comment