Hi
I have below code but it is going to localhost:44351/Admin/some website
I want if Source is Others then link should not go any page. It should display Invoice Value
C#
protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
try
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
RepeaterItem rptitem = e.Item;
HiddenField hdfInvoice = rptitem.FindControl("hdfInvoice") as HiddenField;
Literal ltrlSource = rptitem.FindControl("ltrlSource") as Literal;
if (ltrlSource.Text == "Amazon")
{
HLink hypLink = (Link)e.Item.FindControl("hypUrl");
hypLink.NavigateUrl = some website;
}
}
}
catch (Exception ex)
{
}
}Thanks

Sachin SinghRank #66 · 26.2K reputationPosted Nov 4, 2022, 6:27 AM EDT
when do you set ltrlSource.Text ? is it not Amazon for all?
Ramco RamcoRank #462 · 5.4K reputationPosted Nov 4, 2022, 6:34 AM EDT
Hi Sachin
I am getting this value in itemdatabound . I am facing problem only in below code i want to navigate to Amazon site
HLink hypLink = (Link)e.Item.FindControl("hypUrl"); hypLink.NavigateUrl = some website;
It goes to localhost:44351/www.amazon.com. It gives HTTP Error 404.0 - Not Found
Thanks