linkbutton inside a datalist to get value from xpath

da_judge

New Member
I have the following datalist :\[code\]<asp:DataList ID="DataList1" runat="server" DataSourceID="XmlDataSource1" EnableViewState = "false" Enabled = "false" Visible = "false" Width= "100%" OnItemCommand = "btn_track"> <ItemTemplate runat="server"> <div class= "eachalbum"> <asp:LinkButton runat = "server" CommandArgument = '<%# XPath("name") %>' CommandName = "Redirect"> <%# XPath("name") %> </asp:LinkButton> <br /> <a href = "http://stackoverflow.com/questions/15890920/<%# XPath("url") %>" target = "_blank">Follow <%# XPath("name") %> to last.fm</a> </div> </ItemTemplate> </asp:DataList> protected void btn_track(Object sender, DataListCommandEventArgs e) { if (e.CommandName == "Redirect") // Do required work; }\[/code\]What all I need is to trigger the LinkButton, so that I can use the '<%# XPath("name") %>' in my C# function btn_trackI am not able to fire the above function....
 
Back
Top