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 - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -