jQUERY onclick post
صفحه اصلي

jQUERY onclick post



I want to make a POST request to my Controller with jquery.

function Send() {    $.post("User/Delete/1"); }  <a href="#" onclick="Send()">Delete</a> 

It doesn't work, however if i write this code:

<%= Html.ActionLink("Delete", "Delete", new { onclick = "$.post('User/Delete/1')" })%> 

it works fine. Unfortunetly i cant use this phrase because i need to call that Send() method from a jQUERY UI dialog too.

Thank you


DataAnnotations on a DateTime property

1:

How do I program against a local database while I develop in ASP.NET MVC?
You missed the leading slash:. Validate DateTime with DataAnnotation
 $.post("/User/Delete/1"); 
Jquery ajax post to MVC2 actionasp.net mvc windows azure migration System.BadImageFormatException: Could not load file or assembly 'Interop.SSCE' or

2:

JavaScript action result no longer working after converting to partial view
You may have better luck binding to the Click event using jQuery, which would require you to be able to identify your link. Help! Why do my IE users get randomly logged off? So lets say you commit it an id of postLink, then you could did any thing like:. asp.net mvc jquery form plugin upload(file not recieved by the controller)
$(document).ready(function() {     $("#postLink").click(function() {         $.post("User/Delete/1");     }); }); 


73 out of 100 based on 33 user ratings 553 reviews

^