I'm using Webmatrix 1.1 and MS SQL server 2000.
Thanks in advance.If you're using the default code generated by the Web Matrix it should just work. A few things to check:
1. Are you using a dataset which is bound to the datagrid containing the data which should be displayed? The default paging mechanism only works fine with a dataset using the Web Matrix code.
2. Is there a DataGrid_Page event handler in your code? It should contain:
DataGrid1.CurrentPageIndex = e.NewPageIndex
BindGrid()
Check if the event is registered correctly to the PageIndexChanged event of the datagrid. It should point to the DataGrid_Page event method.
3. The Page_Load event should check for a postback of the page and only bind the data to the grid when there's NO postback:
Sub Page_Load(Sender As Object, E As EventArgs)
If Not Page.IsPostBack Then
' Databind the data grid on the first request only
' (on postback, rebind only in paging command)
BindGrid()
End If
End Sub
Hope this can help you?
Tip: turn page tracing on (Trace = "True") to monitor which events are fired to determine where the problem is located in the code.
Thanks bdesmet, I've got it running now.
0 comments:
Post a Comment