c# - GridView and XMLDataSource -
i want display xml content @ aspx page. there aspx code:
<asp:gridview id="gvxml" runat="server" autogeneratecolumns="true" datasourceid="xmldata"> </asp:gridview> <asp:xmldatasource runat="server" id="xmldata" datafile="items.xml"> </asp:xmldatasource>
and there xml content:
<?xml version="1.0" encoding="utf-8" ?> <inventories> <vehicle name="lanos" year="1984" instock="no"> <rate>ok</rate> </vehicle> <vehicle name="jeep" year="2013" instock="yes"> <rate>dziadowstwo</rate> </vehicle> </inventories>
what wrong, suggestion.
this should assist you. appears missing xpath. can see further documentation here.
in short might such.
<asp:xmldatasource runat="server" id="xmldata" datafile="items.xml" xpath="//vehicle"> </asp:xmldatasource>
edit: although know gridview nice pre-wired control may find more beneficial dig generic repeater , use item templates. in web forms days seemed there needed became overly messy gv. fyi u down road.
Comments
Post a Comment