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

html - Cut text on left side inside button while centering -

java - Last square of 8x8 grid not drawn, using two nested FOR loops -

What design pattern is this code in Javascript? -