exception (ab)use in web development
<p>I find myself using exception in web development even for conditions that are not really errors, let alone exceptional ones - just logic decisions, validations...</p>

<p>in a web page, I often write code like so:</p>

<pre><code>try
{
    int id;
    if(!int.TryParse(txtID.Text, out id))
     throw new Exception("ID must be an integer");

    if(IdAlreadyExists(id))
     throw new Exception("ID already exists in database");

    //and so on...
}
catch(Exception ex)
{
    SetErrorLine(ex.Message);
}
</code></pre>

<p>I was wondering if this is really the correct way of using exceptions and enforcing Business Logic in web development.</p>

<p>P.S.: I am using asp.net, and obviously I could use ASP.NET validators for some of these and also seperate UI from logic, but I'm trying to make a point on the general idea.</p>
