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
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