title: Ajax actionlink
body: <p>I had user control in MVC ASP.NET which list the comments for particular image. I had given delete link with every comment. Now i want to delete that comment using Ajax link. Please tell me how can I use Ajax?</p>
  
  <p>This is my user control and I am calling controller action on delete link:</p>
  
  <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListComment.ascx.cs" Inherits="gConnect.Views.Shared.ListComment" %&gt;
  &lt;li&gt;
              &lt;div class="question-info"&gt;
                  &lt;div class="votes count"&gt;&lt;/span&gt;&lt;span&gt;&lt;% Response.Write("&lt;img src=../../images/" + ViewData.Model.Logo_url.ToString() + " width=75 height=100 &gt;");%&gt; &lt;/div&gt;
  
                  &lt;div class="views "&gt;&lt;span&gt;&lt;%= ViewData.Model.Username.Substring(ViewData.Model.Username.IndexOf("-")+1)     %&gt;&lt;/span&gt;&lt;/div&gt;
                  &lt;div class ="deletem" &gt;&lt;span&gt;&lt;%= Ajax.ActionLink("Delete", "DeleteComment/" + ViewData.Model.Username.Substring(0, 2) + "." + ViewData.Model.Id, new AjaxOptions(UpdateTargetId = "comments"))%&gt;&lt;/span&gt;&lt;/div&gt;
                  &lt;div class="question"&gt;
                      &lt;h3 class="title"&gt;&lt;%= Html.Encode(ViewData.Model.Comment  )%&gt;&lt;/h3&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/li&gt;
  </code></pre>