I have this code that searches a list and returns the title if it matches the search word, but currently if I try searching for 'Test', it does not return the result. As in the list, is it 'test'.
Please assist.
try
{
objCurrentWeb = SPContext.Current.Web;
objSSList = objCurrentWeb.Lists["Sales Materials"];
foreach (SPListItem objSSListItem in objSSList.Items)
{
if (Convert.ToString(objSSListItem["Title"]).Contains(searchWord))
{
resultLabel.Text = objSSListItem["Title"].ToString();
}
}
}
catch (Exception ex)
{
resultLabel.Text = ex.Message;
}