Displaying an error message from my controller, and redirect back to my homepage
<p>I am currently making a DB query request that is being sent from my view "Index.cshtml", however I am trying to give a user a message if they entered a selection that did not come back with with any result.  Currently I have found an example that provide the user a JS box showing them a message when their query comes back empty.  However, when they receive the message it redirects them to a blank page.</p>

<p><strong>My goal is</strong> 
Have a user receive a message when their query request comes back empty.  And just reload the webpage in order for them to retry their query.  This is the following code that I have.</p>

<p><strong>Code</strong>  </p>

<pre><code>        public ActionResult GetClientList(int? marketGroup, int? engagementOffice, int? engagementpartner, int? engagementStatus)
    {
        List&lt;Engagement&gt; QueryResult = PMService.GetRequestedEngagments(marketGroup, engagementOffice, engagementpartner, engagementStatus); 

        if(QueryResult.Count==0)
        {                
            return View("&lt;script language='javascript' type='text/javascript'&gt;alert('Your Search Came Back Empty Please Retry ');&lt;/script&gt;");
        }


        var writetofile = PMService.BuildCsvString(QueryResult);
        var bytefile = Encoding.UTF8.GetBytes(writetofile);


        Response.Clear();
        Response.Buffer = true;
        Response.AddHeader("content-disposition", "attachment;filename=SqlExport.csv");
        Response.Charset = "";
        Response.ContentType = "application/text";
        Response.BinaryWrite(bytefile);
        Response.Flush();
        Response.End();

        return View();

    }
</code></pre>

<p>Currently my condition is catching if the list is being returned empty and giving a message, but after that it takes them to a  blank page.</p>