Selecting the first item of a datalist

G

Guest

I have a datalist on my page. How can I select the first item of the
datalist in loading page for the first time?
 
J

Jos

I have a datalist on my page. How can I select the first item of the
datalist in loading page for the first time?

With Visual Basic:

If(Not IsPostback) Then
DataList1.DataSource= whatever
DataList1.SelectedIndex=0
DataList1.DataBind()
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top