Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: repeater control binding arraylist making crumbs


Message #1 by "jano" <strydom@h...> on Tue, 14 Jan 2003 08:54:36
hi ive got an arraylist full of hyperlinks and i get the current page to 
set the nav-url and nav-title properties of the hyperlinks then i use a 
repeater(bound to my arraylist) to display the hyperlinks and presto 
crumbs or so i thought.

 according to microsoft the repeater should display the hyperlinks if i 
use just  <%#Container.Item%> in the reapeaters itemtemplate in html. but 
i get it telling me its got hyperlinks in there eg displays class name 
but not the hyperlinks themselves.

so now i build hyperlinks from the properties of my hyperlinks in 
arraylist to display but im not happy, this should work without this in 
between work.

below i get the properties of my hyperlinks and set these new links to 
have the same! this works.
 
<template name="ItemTemplate">
   <asp:Hyperlink
NavigateURL='<%#Container.DataItem("navigation_url")%>'
Text='<%#Container.DataItem("navigation_title")%>' runat="server"
/>   |
</template>

whats going on somewhere having hyperlinks in an arraylist isnt working 
right.

1. in this case what is the container? the arraylist or the hyperlinks?
the array should be the container and the links the items, but as seen 
above i can only get at the properties of the hyperlinks and not the 
whole hlink.

2. any ideas?

3. i want to implememnt this in a class that returns a repeater for 
display on my forms(the above propblem is stopping me). each form on 
loading sets the url of hlink and title props(the hlink text) to its own 
values and displays them and as you go along the next page does the same 
and so the crumbs build. 
a form will also ask am i already on the list ie has someone come back to 
me and if so delete all crumbs that come after me(those further down the 
line).  
the crumb is instantiated as a session var so it keeps state between 
pages. 

is this a hairbrained scheme?


one final thing if you use the back button on page 2 the previous page 
loads from cache, and the code that says am i(current page) on the list 
if so make me last by deleting those below me doesnt run -  the pages 
crumb displays correctly   because its the cached page, but the actual 
crumb control now holds crumbs for page 1(current) and 2. so if i now go 
to page 3(new page) i will see crumb for 1,2,3 instead of 1,3.

to resolve this for the current page say in the crumb class - is the 
calling page directly above me in the arraylist(refferer url property) if 
not delete items above me untill i get it just above me).

comments, ideas and death threats appreaciated.
jano 

  Return to Index