title: Doesn't get success message in Magento
body: <p>I have controller called IndexController.php. I am getting message when i delete record in deleteAction().But i doesn't get any message when i add or edit record in addcategoryAction.Can anyone please look at in my controller and check why i doesn't get any message in addcategoryAction.  Here is my controller.</p>
  
  <pre><code>&lt;?php
  class Company_Web_IndexController extends Mage_Core_Controller_Front_Action
  {
      public function indexAction()
      {    
          $this-&gt;loadLayout();     
          $this-&gt;renderLayout();
      }
  
      public function addcategoryAction()
      {
          if ($this-&gt;getRequest()-&gt;isPost()) 
          {
              $data = $this-&gt;getRequest()-&gt;getParams();
              $id = $data['editid'];
              $catName = $data['catName'];
              $status = $data['status'];
              $data = array('name'=&gt;$catName,'status'=&gt;$status);
              $model = Mage::getModel('web/web');
              if($id == '')
              {
                  $model-&gt;setData($data);
                  try {
                          $insertId = $model-&gt;save()-&gt;getId();
                  } catch (Exception $e){
                   echo $e-&gt;getMessage();
                  }
                  Mage::getSingleton('core/session')-&gt;addSuccess($this-&gt;__('Category has been successfully Added'));
              }
              else
              {
                  $model-&gt;load($id)-&gt;addData($data);
                  try {
                          $model-&gt;setId($id)-&gt;save();
                  } catch (Exception $e){
                      echo $e-&gt;getMessage();
                  }
                  Mage::getSingleton('core/session')-&gt;addSuccess($this-&gt;__('Category has been successfully Updated'));
              }
              $this-&gt;_redirect('web/index/category');
  
          }
          $this-&gt;loadLayout();     
          $this-&gt;renderLayout();
      }
  
      public function categoryAction()
      {
          $this-&gt;loadLayout();
          $this-&gt;renderLayout();
      }
  
      public function deleteAction()
      {
          $id =  $this-&gt;getRequest()-&gt;getParam('id');
          $model = Mage::getModel('web/web');
          $model-&gt;setId($id)-&gt;delete();
          Mage::getSingleton('core/session')-&gt;addSuccess($this-&gt;__('Category has been successfully Deleted'));
          $this-&gt;_redirect('web/index/category');
      }
  }
  
  ?&gt;
  </code></pre>