如何在数据表列中将字符串转换为超链接?它不适用于网址。请协助。它在visual studio中使用c#编码。我添加了数据表。
try
{
DataTable result = new DataTable();
result.TableName = "Result";
result.Columns.Add("Title");
result.Columns.Add("Name");
result.Columns.Add("Content");
result.Columns.Add("Link");
foreach (SPListItem objSSListItem in objSSList.Items)
{
String title = objSSListItem["Title"].ToString();
String name = objSSListItem["Name"].ToString();
String content = objSSListItem["Content Type"].ToString();
if (title.ToUpper().Contains(searchWord.ToUpper()) || name.ToUpper().Contains(searchWord.ToUpper()) || content.ToUpper().Contains(searchWord.ToUpper()))
intMemberIndex = objSSListItem.ID;
String url = "http://xxx" + objSSListItem.Url;
documentLink.NavigateUrl = url;
HyperLink hl = new HyperLink();
result.Rows.Add(title, name, content,url);
}
}
FillResultsGrid(result);
}