|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using templates with custom repeater control
Hi. I want to create my own repeater control. I am not sure how to use templates with it (header, body, footer). How do I find the html and databinding expressions that are between the opening (<itemTemplate>) and closing (</itemTemplate>) xml tags and only repeat that portion of html and print the header and footer templates only once. If anyone has any sample VB code on how to do this or is able to explain this I would really appreciate it.
thanks so much, Barret |
|
#2
|
|||
|
|||
|
See if these help:
http://samples.gotdotnet.com/quickst...aspx#templated http://msdn.microsoft.com/msdnmag/is...6/CuttingEdge/
__________________
Phil Weber http://www.philweber.com Please post questions to the forums, where others may benefit. I do not offer free assistance by e-mail. Thank you! |
|
#3
|
|||
|
|||
|
not quite
Thank you for your reply but that is not exactly what I am looking for.
I want to create a custom databound control to display search results of products from an online store's database. I want to display a ceratain amount of products per page and allow the user to be able to skip to different pages, next page, prev page, display number of results etc. So I want to use a for loop to print out the resulting products and stop the loop when the incrementer hits a certain number and start the incrementer at different numbers depending on what page the user is on. That's easy enought to do, I could do that. However, I don't want any of my html in my custom databound control. I want the custom databound control's for loop to print out the values for the databinding expressions <% Eval("whatever object property") %> within the template. for ex: <emptyResultSet> Your search did not produce any results..... </emptyResultSet> <searchResult> <table> <tr> <td> <span style="whatever"><% Eval("ProductName") %></span> <div style="whatever">< Eval("ProductPrice") %></span> </td> </tr> </table> </searchResult> <resultSetInfo> <table><tr><td>Next, Prev, First, Last (How many results)</td></tr></table> </resultSetInfo> I above html does not make any sense it is just an example. So, I don't know how (from within the control) to get the html from the <searchResult> opening and closing xml template tags and print that in the for loop while evaluating the databinding expressions. I hope you could help, thank you so much, Barret |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Custom Control Properties | Jugg | .NET | 2 | 03-07-2006 07:40 AM |
| Loading Custom Control onto the form | Sync | VB Classic | 4 | 12-07-2005 02:21 AM |
| Set focus on a element inside a repeater control | mannabaron | ASP.NET | 1 | 08-23-2005 08:42 AM |
| Failed to load control 'DataEditGrid' from custom ocx. | szoli | VB Classic | 6 | 02-22-2005 03:12 AM |
| ListView Control and Custom Sorting | Birhanu | VB Classic | 0 | 11-09-2001 04:26 PM |