If you are really keen to stick with asp.net server controls you could have an anchor inside your repeater and add the href attribute through code in the item data bound procedure. You will have to include a hidden field in your repeater though.
If your repeater is something like
then the Repeater1_ItemDataBound procedure would beCode:<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound"> <ItemTemplate> <asp:HiddenField ID="myh" value='<%#DataBinder.Eval(Container.DataItem,"id") %>' runat="server" /> <a id="mya" runat="server" /> </ItemTemplate> </asp:Repeater>
This would open a pop up with target.aspx when you click on the link.Code:protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { HiddenField h = (HiddenField)e.Item.FindControl("myh"); HtmlAnchor a = (HtmlAnchor)e.Item.FindControl("mya"); a.HRef = "javascript:window.open('target.aspx?id=" + h.Value + "','','height=350,width=350')"; a.InnerText = h.Value; } }
Warm Regards,




Reply With Quote