I have a webpage that is a Search page. There are a few pre-defined searches that need to be in place. The method I have taken to handle this, along with normal searches, is to have the QueryString force the search. There is a search querystring, currently about 10 or so different "searches".
I then have a ProcessSearch method with a switch it in the setup and perform each search:
switch (QueryString)
{
case "person":
SearchPerson();
break;
case "firstname":
firstNameText = inputtedValue;
SearchPerson();
break;
.
.
.
}
You get the idea, I hope. Is there a better way to do this. Just seems like I might be missing a simplier, easier to read solution.
One last edit:
Does making the strings Enums buy me anything?