How to create stackoverflow's post voting like jquery/ajax function?

Posted by Daoming Yang on Stack Overflow See other posts from Stack Overflow or by Daoming Yang
Published on 2010-04-17T20:21:31Z Indexed on 2010/04/17 22:03 UTC
Read the original article Hit count: 296

Filed under:
|
|

Can I use Jquery to call an action and then change the image when it success, just like stackoverflow's post voting function?

In my view, I'm using the following code, but I don't want to refresh the browser. Can anyone provide some code about this for me?

Many thanks.

<%if (!item.IsPrinted)
{ %>
     <%=Html.ImageLink("~/Content/images/web/delete.png", "printed", "MarkAsPrinted", "Order", item.TaskID, null, null)%>
 <%}
 else
  {%>
       <img src="~/Content/images/web/star.png" alt="printed" />                    
  <% }  %>

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about jQuery