Setting TextBox focus in BLL ASP.NET
<p>I'm working on an application where the validation (ranges) checks are controlled in the business logic layer. The code looks similar to this:</p>

<pre><code>public string ValidateRange(int value, int lowRange, int highRange, string fieldDesc, System.Web.UI.WebControls.TextBox txtBox)
{
     string msg = "";

     if (value &gt;= lowRange &amp; value &lt;= highRange)
         msg = "";
     else
     {
         msg = "Please enter a value between " + lowRange + " and " + highRange + " for \"" + fieldDesc + ".\"";
         txtBox.Focus();
     }

     return msg;
}
</code></pre>

<p>I'm pretty sure I'm doing this incorrectly so I was hoping someone can explain to me the most efficient way of handling the function and BLL so that it can pass to the Presentation layer nicely. My hope is that I can limit my interaction with the BLL to ValidateRange checks on the form's TextBox controls with a return for each. If I'm approaching this incorrectly, please let me know. If it does work this way, how can I allow the BLL to access the TextBoxes from the Presentation Layer?</p>

<p>Thanks for your help.</p>
