Noise words in full text search....

  • Thread starter Thread starter macyp
  • Start date Start date
M

macyp

I am developing a search page. If the users enter, words like "and",
"an" etc, it gives an error. I read something abt noise words. I want
to display a friendly error message to the users if they enter noise
words.
I am storing all the noise words in an array, and string comparing the
keyword the user entered with each element of the array, else
redirecting them to a searchresults page. But when I am doing this, it
is redirecting to the searchresults page anyway...with an error abt the
noise words.
How can I do error handling so that, when the error is about noise
words, it displays an alert box, or something like that and asks the
user to redefine their search.
Any suggestions?
 
Hi there,

One way you can show message on client-side is like this:

Add a lablebox, lblMessage, in search page.
Then
if(findNoiseWords()){
lblMessage.Text = "<script>alert('" + strMessage + "')
</script>";
}else{
Response.Redirect(searchresults.aspx);
}

Hope it helps,

Elton Wang
(e-mail address removed)
 
Back
Top