前台: <a href="<%# ChangeUrl(Eval("ID").ToString(),Eval("fk").ToString()) %>" Target="_blanks"> <%#Eval("Name")%></a>
后台:
public string ChangeUrl(string id,string fid)
{
try
{
string Url = "";
if (id.Equals(fid))
{
Url = "OtherViews.aspx?id=" + id + "&fid=" + fid;
}
else
{
Url = "MainViews.aspx?id="+id+"&fid="+fid;
}
return Url;
}
catch (Exception)
{
return "";
}