Highlighting text
How to highlight search text in asp.net??
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Santosh KumarPosted May 18, 2011, 3:24 AM
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).
Posted May 18, 2011, 3:22 AM
Please provide more information.
Anil KumarPosted May 18, 2011, 3:16 AM