<style type="text/css">
.highlight { FONT-WEIGHT: bold; BACKGROUND: blue; COLOR: white; TEXT-DECORATION: none }
</style>
.highlight { FONT-WEIGHT: bold; BACKGROUND: blue; COLOR: white; TEXT-DECORATION: none }
</style>
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
lblTxt.Text = "Give the proper respect to hand-coding.You should both respect and loathe handwritten code. You should respect it because there are often special cases integrated into code that are overlooked with a cursory inspection. When replacing code you’ve written by hand, you need to make sure you have the special cases accounted for. You should loathe hand-code because engineering time is extremely valuable, and to waste it on repetitive tasks is nearly criminal. The goal of your generator should always be to optimize the organization’s most valuable assets.the creativity and enthusiasm of the engineering team.";
}
private void btnSubmit_Click(object sender, System.EventArgs e)
{
lblTxt.Text = ToHighlight(txtKeywords.Text, lblTxt.Text);
}
{
// Put user code to initialize the page here
lblTxt.Text = "Give the proper respect to hand-coding.You should both respect and loathe handwritten code. You should respect it because there are often special cases integrated into code that are overlooked with a cursory inspection. When replacing code you’ve written by hand, you need to make sure you have the special cases accounted for. You should loathe hand-code because engineering time is extremely valuable, and to waste it on repetitive tasks is nearly criminal. The goal of your generator should always be to optimize the organization’s most valuable assets.the creativity and enthusiasm of the engineering team.";
}
private void btnSubmit_Click(object sender, System.EventArgs e)
{
lblTxt.Text = ToHighlight(txtKeywords.Text, lblTxt.Text);
}
public string ToHighlight(string strSearch, string txtContent)
{
Regex RegExp = new Regex(strSearch.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase);
return RegExp.Replace(txtContent, new MatchEvaluator(ReplaceKeyWords));
}
public string ReplaceKeyWords(Match m)
{
return "<span class=highlight>" + m.Value + "</span>";
}
{
Regex RegExp = new Regex(strSearch.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase);
return RegExp.Replace(txtContent, new MatchEvaluator(ReplaceKeyWords));
}
public string ReplaceKeyWords(Match m)
{
return "<span class=highlight>" + m.Value + "</span>";
}