You can concat the client-side variables with the server-side url generated by this method, which is a string on the output. and here is the php code in the same file (header.php): I'm not able to send request to server, i got a 404 error. wp_ajax_* and wp_ajax_nopriv_*. I haven't tried passing multiple variables using this method but I'm hopeful that also can be appended to the Url if required. POST Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide, I ended up adding an onclick event to a element which appended to the href attribute which was set using Url.Action. And you mustn't mix http: and https: assets on the same page, An example that shows the difference between the defaultValue and value property: HTML reference: HTML value Attribute. Is email scraping still a thing for spammers. Here is the implementation of the working code. Also, pass CSRF_TOKEN along with search value in the data. Step 1- Create a HTML