title: Unable to evaluate expression
body: <p>I am using a class to check for certain words in my application to prevent SQL Injection.</p>
  
  <p>In the class, there is a for loop that tries to match a specific word with the words from a blacklist.
  If there is a match, I must redirect to the system's error page.</p>
  
  <p>However, when a match is found and I try to redirect, I keep getting the error "Unable to evaluate expression."</p>
  
  <p>Here is the code:</p>
  
  <pre><code>Private Sub CheckInput(ByVal parameter As String)
  Try
      Dim errorPage As String = "error_page.aspx?Injection=" &amp; parameter
  
      For i As Integer = 0 To blackList.Length - 1
          If (parameter.IndexOf(blackList(i), StringComparison.OrdinalIgnoreCase) &gt;= 0) Then
              'Handle the discovery of suspicious Sql characters here 
              'generic error page on your site 
              HttpContext.Current.Response.Redirect(errorPage)
          End If
      Next
  
  Catch ex As Exception
      Throw ex
  End Try
  </code></pre>
  
  <p>Once the Try block catches the error, it keeps giving the error and doesn't redirect to the error page.</p>
  
  <p>Any ideas?</p>