c# - Issue using <asp:Repeat> to repeat <a> tags, specifically the inner text property -
I am running asp.net 4.0 on VS2013, and I'm having trouble understanding ASP repeater completely. What I'm trying to do is look like this:
& lt; Div id = "datesDivContainer> ASP: repeater runat =" server "id =" repeater "DataSourceID =" listToAddToHTML "& gt; item item & gt; & lt; div & gt; & lt; a href = current date Aspx? Date = "+ + & Gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; / ItemTemplate & gt; & Lt; ASP: Repeater & gt; & Lt; / Div & gt;
Now, what do I need to do is set text of the Template Link Tag item values of the data source list of repeater's data source (eg date 28/10/2014, hence the text link 28/10/2014, 27/10/2014, and whatever is in the XML file).
The date is made up of elements in the list, and is initiated in the following way:
var list = new list & lt; String & gt; (); XDocument XMLDatesDocument = XDocument.Load ("MenuPerDate.xml"); Excellence Pointer = XMLDatesDocument.Element ("Menu"). Element ("menu"); While (pointer! = Null) {var date = pointer.Element ("date"). Values; If (pointer.AllmentsAffier (). Calculation ()> 0) Pointer = Pointer Elements end self (). Element (0); Other pointer = null; List.Add (date); } Repeater.DataSource = List;
The XML file looks like this:
& lt; Menu & gt; & Lt; Menu & gt; & Lt; Date & gt; ... & lt; / Date & gt; & Lt; / Menu & gt; & Lt; / Menu & gt;
Comments
Post a Comment