I have a link and search button. Clicking on search button posts the page to a predefined action. Now clicking on a link should post the page to another action and should post all the values hidden varible values to another action. Can it be done.
Share
Typically A link will generate an anchor tag and it usually gives you an HTTP GET request. Not the post request. You can supply parameters in your link which will be accepted as the parameters of the
actionmethodThis will generate a link with a querystring key called id with value nokia.
or
And your action method with
idparameter can handle thisGETrequestIF you really want to do an
HTTPPostfrom a link, You can grab the click event of the link in the javascript and make an httppost call. The below script does that with jQuery library.But make sure you have an HttpPost version of the ActionMethod in your controller to handle this request