title: ASP.NET MVC Show success message
body: <p>Here is an example method I have that deletes a record from my app:</p>
  
  <pre><code>[Authorize(Roles = "news-admin")]
  public ActionResult Delete(int id)
  {
      var ArticleToDelete = (from a in _db.ArticleSet where a.storyId == id select a).FirstOrDefault();
      _db.DeleteObject(ArticleToDelete);
      _db.SaveChanges();
  
      return RedirectToAction("Index");
  }
  </code></pre>
  
  <p>What I would like to do is show a message on the Index view that says something like: "Lorem ipsum article has been deleted" how would I do this? Thanks</p>
  
  <p>Here is my current Index method, just in case:</p>
  
  <pre><code>    // INDEX
      [HandleError]
      public ActionResult Index(string query, int? page)
      {
          // build the query
          var ArticleQuery = from a in _db.ArticleSet select a;
          // check if their is a query
          if (!string.IsNullOrEmpty(query))
          {
              ArticleQuery = ArticleQuery.Where(a =&gt; a.headline.Contains(query));
              //msp 2011-01-13 You need to send the query string to the View using ViewData
              ViewData["query"] = query;
          }
          // orders the articles by newest first
          var OrderedArticles = ArticleQuery.OrderByDescending(a =&gt; a.posted);
          // takes the ordered articles and paginates them using the PaginatedList class with 4 per page
          var PaginatedArticles = new PaginatedList&lt;Article&gt;(OrderedArticles, page ?? 0, 4);
          // return the paginated articles to the view
          return View(PaginatedArticles);
      }
  </code></pre>