G
Guest
I'm having a problem getting the data binding to work with the repeater control. Here's the code for the code-behind class
private void Page_Load(object sender, System.EventArgs e
if (!this.IsPostBack
DataView dv = new DataView(AlbumMgr.Instance.GetAlbumsList())
rptalbums.DataSource = dv
rptalbums.DataBind()
Here's the script for the repeater
<asp:Repeater id="rptalbums" runat="server"><ItemTemplate><tr><td class="alternate" width="*"><a href="#" onclick='SelectAlbum(<%# DataBinder.Eval(Container.DataItem, "AlbumKey");%>); return false;' target="frmmain"><%# DataBinder.Eval(Container.DataItem, "Title");%></a></td><td class="alternate" width="16px"><a href="#" onclick='RemoveAlbum(<%# DataBinder.Eval(Container.DataItem, "AlbumKey");%>); return false;'><img border="0" src="images/trash.gif" /></a></td></tr></ItemTemplate><AlternatingItemTemplate><tr><td class="alternate" width="*"><a href="#" onclick='SelectAlbum(<%# DataBinder.Eval(Container.DataItem, "AlbumKey");%>); return false;' target="frmmain"><%# DataBinder.Eval(Container.DataItem, "Title");%></a></td><td class="alternate" width="16px"><a href="#" onclick='RemoveAlbum(<%# DataBinder.Eval(Container.DataItem, "AlbumKey");%>); return false;'><img border="0" src="images/trash.gif" /></a></td></tr></AlternatingItemTemplate><--snip--
No matter what I try, I always get error "CS1026: ) expected"
Could anyone point out what I am doing wrong?
private void Page_Load(object sender, System.EventArgs e
if (!this.IsPostBack
DataView dv = new DataView(AlbumMgr.Instance.GetAlbumsList())
rptalbums.DataSource = dv
rptalbums.DataBind()
Here's the script for the repeater
<asp:Repeater id="rptalbums" runat="server"><ItemTemplate><tr><td class="alternate" width="*"><a href="#" onclick='SelectAlbum(<%# DataBinder.Eval(Container.DataItem, "AlbumKey");%>); return false;' target="frmmain"><%# DataBinder.Eval(Container.DataItem, "Title");%></a></td><td class="alternate" width="16px"><a href="#" onclick='RemoveAlbum(<%# DataBinder.Eval(Container.DataItem, "AlbumKey");%>); return false;'><img border="0" src="images/trash.gif" /></a></td></tr></ItemTemplate><AlternatingItemTemplate><tr><td class="alternate" width="*"><a href="#" onclick='SelectAlbum(<%# DataBinder.Eval(Container.DataItem, "AlbumKey");%>); return false;' target="frmmain"><%# DataBinder.Eval(Container.DataItem, "Title");%></a></td><td class="alternate" width="16px"><a href="#" onclick='RemoveAlbum(<%# DataBinder.Eval(Container.DataItem, "AlbumKey");%>); return false;'><img border="0" src="images/trash.gif" /></a></td></tr></AlternatingItemTemplate><--snip--
No matter what I try, I always get error "CS1026: ) expected"
Could anyone point out what I am doing wrong?