You are showing the Hyperlink in the Repeater. If your Repeater Item is more than1 then which Hyperlink value you want to get?
You need to add the Button in your Repeater ItemTemplate and get the value of Hyperlink OnClick event of Button.
Please refer this example.
HTML
<asp:Repeater ID="CloudTags" runat="server">
<ItemTemplate>
<table border="0" cellpadding="2" cellspacing="2">
<tr>
<td>
<asp:HyperLink ID="lnkCategory" runat="server" Text='<%# Eval("Category")%>' NavigateUrl='<%# Eval("Category","www.abc.com?id={0}") %>'>
</asp:HyperLink>
</td>
<td>
<asp:Button Text="Get link value" OnClick="GetValue" runat="server" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
Namespace
using System.Data;
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.Add("Category");
dt.Rows.Add("Sports");
dt.Rows.Add("Health");
dt.Rows.Add("Education");
this.CloudTags.DataSource = dt;
CloudTags.DataBind();
}
}
protected void GetValue(object sender, EventArgs e)
{
RepeaterItem item = (sender as Button).NamingContainer as RepeaterItem;
HyperLink lnk = item.FindControl("lnkCategory") as HyperLink;
ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + lnk.Text + "')", true);
}