asp.net mvc 4 - Calling post method on link click jQuery -


i wan use anchor tag post page on page in mvc.
problem when click on hyperlink takes controller. not hit post method.
hit method.
can create method on acnhor in jquery post page page.

suppose have anchor on page1

 <a href="/home/action">click here</a>  <input type="hidden" value="2"/> 

and should hit post method on home action.

use tag.

<form method='post' name='frmpost' id='frmpost' action='/home/action'> <a id='clickme'>click here</a>  <input type="hidden" name='hiddenvalue' value="2"/> </form>  $('#clickme').click(function(){ $('#frmpost').submit(); }); 

hey, may


Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -