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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

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

ios - I get the error Property '...' not found on object of type '...' -