I’m setting up a simple page that just displays the contents of an XML file and allows the user to filter by keyword.
I’m a serious .NET newb, but I’ve got an XmlDataSource set up:
<asp:XmlDataSource ID='RSSFeedDataSource' runat='server' DataFile='test.xml' XPath='/rss/channel/item[contains(title,'theKeyword')]'></asp:XmlDataSource>
So I want to allow users to type in a keyword and change the data source based on that.
I figured I’d do a postback with the keyword from a text input, grab that keyword and somehow insert into the XPath expression…
I’m going for simplicity at this point, but would this be the simplest approach for this?
Method to grab it via code behind and a button postback
ASP Page:
Code behind: