问题描述
您好,
我想在数据库中的任何用></term>括起来的术语上创建一个LinkButton.标签.我的问题是如何在数据库中创建LinkButton,而不是当前如何使用它.现在,我将匹配的术语存储在占位符中.
谢谢!
foreach(DataRow行)
{
System.Text.RegularExpressions.Regex regex = new System .Text.RegularExpressions.Regex((?? == term))* *(?=</term>)");
System.Text.RegularExpressions.Match match = regex.Match (row ["Definition"].ToString());
LinkButton lb1;
lb1 = new LinkButton();
lb1.Text = match.ToString();
PlaceHolder2.Controls.Add(lb1);
lb1.Click + = new EventHandler(lb1_Click);
}
Hello,
I would like to create a LinkButton on any term in the database that is enclosed by <term></term> tags. My problem is how do I create the LinkButton in the database and not how I currently have it working. Right now I am storing the matched term in a placeholder.
Thanks!!
foreach (DataRow row in rows)
{
System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("(?<=<term>). *(?=</term>)");
System.Text.RegularExpressions.Match match = regex.Match(row["Definition"].ToString());
LinkButton lb1;
lb1 = new LinkButton();
lb1.Text = match.ToString();
PlaceHolder2.Controls.Add(lb1);
lb1.Click += new EventHandler(lb1_Click);
}
推荐答案
这篇关于LinkButton的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!