Noise words in full text search....

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?
 
E

Elton Wang

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top