前端代码:
<td align="center">
<%=getlink(Eval("title").ToString(),Convert.ToInt32(Eval("id")))%>
</td>
后端代码:
public string getlink(string title, int id)
{
string a = string.Empty;
if (title == "游客")
{
a = "<span style='color:gray'>游客</span>";
}
else
{
a = "<a href='group_edit.aspx?action=" + DTEnums.ActionEnum.Edit + "&id=" + id + "'>" + title + "</a>";
}
return a;
}