By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

need help with repeaters

P: 65
Hi,

I have a list of around 10 links (<a>).

<a href="one">one</ a>

<a href="two"><two></a>

...

..

<a href="ten"><ten></a>



the thing is that i need to populate the values one, two , three from the database.. please note the one, two etc in the <a> tags are not the ones which needs to be popu;ated from the database, but the ones between the <a> are the ones which needs to be populated from the database.

so how can i do this keeping in mind on clicking each link should go to the sprecified url.



Thanks.

Nitin
Apr 19 '07 #1
Share this Question
Share on Google+
1 Reply


P: 6
I suposse your links-data are read from a database, i.e. you are generating a dynamic menu or similar.

In the On_Load event (in your .vb if you use vb.net) you read the database and fill a dataset asigning this dataset to the aspx repeater (Me.XX).

In your aspx code you have a <asp:repeater runat="server" id="XX"> inside the <asp:repeater></asp:repeater> you can place an <asp:itemtemplate></asp:itemtemplate> just code inside the itemtemplate your <a href=""></a> reading the current item value.

In the microsoft msdn web there are a couple of good examples regarding <asp:repeater>s.
Apr 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.