c# - No action on Html.Beginform -
i have @using (html.beginform())
on partial view on application developing. have textbox on page , on clicking come in button after entering textbox submitting form. there anyway can tell mvc not preform action in beginform helper?
i tried passing @using (html.beginform(null))
got same result. realise take out html.beginform , utilize tags , have javascript homecoming false submit action wondering there anyway can accomplish behavior html.beginform?
update - showing partial view
<div class="row"> <div class="col-xs-12 h-form no-padding"> @using (html.beginform(null)) { @html.antiforgerytoken() <p> <div> <input id="txtsearch" type="text" placeholder="search..."> </div> </p> } </div> </div>
update ii seems if there 1 text field there , nail come in form submitted on post action. if set 2 text fields on page hitting either no post action invoked.
anyway going remove html.beginform() , utilize <form onsubmit="return false">
if want when click on submit button form doesn't submit.the submit button type must button
<input **type="button"** value="create" onclick="ajaxsubmit();" />
c# asp.net-mvc asp.net-mvc-5 html-helper
No comments:
Post a Comment