How to pass void return type into Json
<p>Please help me. How can I pass message from void to return type?</p>

<p><strong>WebApi.cs</strong></p>

<pre><code>public void DeleteById(int id)
{
    string meassga = "";
    try
    {
        objser.DeleteBYId(id);
    }
    catch (Exception ex)
    {
        meassga = "" + ex;
    }

}
</code></pre>

<p><strong>Mvc.cs</strong></p>

<pre><code>public JsonResult DeleteById(int id)
{
   string meassga = "";
   ss.DeleteBYId(id);
   return Json ( meassga,  JsonRequestBehavior.AllowGet );
}
</code></pre>

<p>Here I'm passing data from mvc to webApi &amp; I want to show error details from api controller to mvc json control</p>