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
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
Ramco RamcoPosted Nov 4, 2022, 10:34 AM
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
Sachin SinghPosted Nov 4, 2022, 10:27 AM
when do you set ltrlSource.Text ? is it not Amazon for all?