Highlighting text
How to highlight search text in asp.net??
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Anil KumarRank #367 · 6.8K reputationPosted May 17, 2011, 11:16 PM EDT
Posted May 17, 2011, 11:22 PM EDT
Please provide more information.
Santosh KumarRank #2,303 · 613 reputationPosted May 17, 2011, 11:24 PM EDT
1>
DataHelper hlpr = new DataHelper(AppWrapper.DBConnection);
DataTable dt = hlpr.SearchFAQs(searchString);
if (dt.Rows.Count > 0)
{
StringBuilder sb = new StringBuilder();
foreach ( DataRow dr in dt.Rows)
{
string coloredSearchString =
string.Format("{0}",
searchString);
string question = NullableTypeHelper.NullSafeToString(dr["Question"]);
string answer = NullableTypeHelper.NullSafeToString(dr["Answer"]);
// create regex replace pattern and make it safe by escaping it
string searchPattern = string.Format("(?
string replacePattern =
"${find}";
// color the searched for text yellow in question and answer
question = Regex.Replace(question, searchPattern, replacePattern,
RegexOptions.IgnoreCase);
answer = Regex.Replace(answer, searchPattern, replacePattern,
RegexOptions.IgnoreCase);
string concat = string.Format("
{1}
"
question, answer);
sb.Append(concat);
} // foreach
litSearchAnswers.Text=sb.ToString();
} // if
else
{
litSearchAnswers.Text = GetLocalResourceObject("MsgNotFound").ToString();
} // else
2>
What steps do I follow before sending a message to my contact list?
1. Set up your Business account.
2. Create a contact list of people who will receive your message(s).
3>
What steps do I follow before sending a message to my contact/member list?
1. Set up your Business account.
2. Create a contact list of people who will receive your message(s).