DataPager Strange Behavior

S

shapper

Hello,

I am using the new ASP.NET 3.5 ListView and DataPager.

Everything is working fine but I am getting a strange behavior in the
DataPager.

When I click a pager button for the first time nothing happens.

When I click the second time it starts to work.

For this moment on every time I click a pager button the action taken
is the correspondent to my previous click.

What is going on?

My ListView uses a Linq as DataSource:

Private Sub lvTags_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles lvTags.Init
With lvTags
.DataKeyNames = New String() {"TagId"}
.DataSource = ldsTags
.ID = "lvTags"
.ItemTemplate = New
ListTemplate(ListTemplate.TemplateType.ItemTemplate)
.LayoutTemplate = New
ListTemplate(ListTemplate.TemplateType.LayoutTemplate)
End With
End Sub

Private Sub lvTags_Load(ByVal sender As Object, ByVal e As
EventArgs) Handles lvTags.Load
lvTags.DataBind()
End Sub

Private Sub ldsTags_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles ldsTags.Init
ldsTags.ID = "ldsTags"
End Sub

Private Sub ldsTags_Selecting(ByVal sender As Object, ByVal e As
LinqDataSourceSelectEventArgs) Handles ldsTags.Selecting
Dim cms As New CMSDataContext
Dim tags = From t In cms.Tags _
Select t.TagID, _
t.Text
e.Result = tags
End Sub


The DataPager is created in the LayoutTemplate of my ListView
implemented by the class ListTemplate that I created:

Private Sub dpTags_Init(ByVal sender As Object, ByVal e As
EventArgs)

Dim dpTags As DataPager = CType(sender, DataPager)
Dim npfPages As New NumericPagerField
With npfPages
.ButtonCount = 5
.ButtonType = ButtonType.Link
........................................
End With

With dpTags
.ID = "dpTags"
.PageSize = 8
.Add(npfPages)
End With

End Sub

What am I doing wrong?

Thanks,

Miguel
 

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,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top