I would create a function that will create that link for you. This is in C#
but you should be able to convert it for what you need.
//html
<ASP:LABEL id="Label1" runat="server"><%# this.GetNavURL(Container.DataItem,
"ctg_key")%>'</ASP:LABEL>
//code behind
public string GetNavURL(object Row, string Column)
{
//here you can check the value
string myval = GetRowValue(Row, Column);
if (myval == null) return "";
return "<a href='../item.aspx?key=" + myval + "'>" + Click Here + "</a>";
}
public static string GetRowValue(object Row, string Column)
{
string val = "";
if (Row is System.Data.DataRowView) val =
((System.Data.DataRowView)Row)[Column].ToString();
if (Row is System.Data.DataRow) val =
((System.Data.DataRow)Row)[Column].ToString();
if (Row is System.Data.Common.DbDataRecord) val =
((System.Data.Common.DbDataRecord)Row)[Column].ToString();
return val;
}
HTH
"Jason" wrote:
I have a repeater in which I would like to do some
conditional processing.
<asp:HyperLink NavigateUrl='<%# Container.DataItem
("Survey") %>' Runat="server" ID="hypSurvey">Open
Survey</asp:HyperLink></td>
In the example above, If the Container.DataItem("Survey")
is null, I don't want to display the "Open Survey" text.
How can I do this using VB?