A
AC [MVP MCMS]
Implementing databinding from the ASPX/ASCX file is very
straightforward:
<asp:XmlDataSource id="XmlDs1" DataFile="[some RSS feed]">...</>
<asp:Repeater>
<HeaderTemplate><%#XPath("title")%></>
</>
However, what if you wanted to do this ONLY from the code behind? For
example, if I didn't have a repeater on an ASPX page or anything... it
would be added dynamically. How you do you do something like this:
// bind XmlDataSource to a repeater
// create & add an ASP.NET HyperLink control to the HeaderTemplate of a
repeater that was added to the page.
someLink.NavigationUrl = "#XPath("title") ; // I know this won't
work, just trying to convey the concept
Is this even possible? I'm fairly certain it is, just keep hitting a
dead end and can't find any articles out there that demonstrate it.
TIA,
straightforward:
<asp:XmlDataSource id="XmlDs1" DataFile="[some RSS feed]">...</>
<asp:Repeater>
<HeaderTemplate><%#XPath("title")%></>
</>
However, what if you wanted to do this ONLY from the code behind? For
example, if I didn't have a repeater on an ASPX page or anything... it
would be added dynamically. How you do you do something like this:
// bind XmlDataSource to a repeater
// create & add an ASP.NET HyperLink control to the HeaderTemplate of a
repeater that was added to the page.
someLink.NavigationUrl = "#XPath("title") ; // I know this won't
work, just trying to convey the concept
Is this even possible? I'm fairly certain it is, just keep hitting a
dead end and can't find any articles out there that demonstrate it.
TIA,