I have found some interesting information about the paging control, and while I'm still having trouble, this is what I have found...
In my ASP page I have this code at the top:
<%@ Register TagPrefix="dnn" Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" %>
Then on the page, I refrence this code:
<dnn:pagingcontrol id="ctlPagingControlMyIdeas" runat="server" CssClass="Normal"
BackColor="Transparent"></dnn:pagingcontrol>
On the backend in VB:
Private Overloads Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
Try
If Not (Request.QueryString(Utility.CurrentPage) Is Nothing) Then
CurrentPage = Int32.Parse(Request.QueryString(Utility.CurrentPage))
CurrentPageIndex = CurrentPage - 1
End If
'If Not Page.IsPostBack Then
Dim oControler As New IdeaController
Dim oIdeas As List(Of IdeaInfo) = oControler.GetApprovedIdeas(ModuleId)
Dim oPageDataSource As New PagedDataSource ' - This is where I call the pageDataSource
oPageDataSource.DataSource = oIdeas '- I then set it to the Ideas list
If Me.PageSize > 0 Then
oPageDataSource.PageSize = PageSize
oPageDataSource.CurrentPageIndex = _CurrentPage - 1
oPageDataSource.AllowPaging = True
End If
grdAllIdeas.DataSource = oPageDataSource ' I set the grids datasource
grdAllIdeas.DataBind() ' and bind it.
If PageSize = 0 OrElse grdAllIdeas.Items.Count <= PageSize Then
ctlPagingControlSearch.Visible = False
Else ' from here I set it to be visible and set it's properties with a with statement
ctlPagingControlSearch.Visible = True
With ctlPagingControlSearch
.TotalRecords = oControler.Count
.PageSize = PageSize
.TabID = TabId
End With
End If
Catch ex As Exception
'MsgBox("Failed and didn't return a value", MsgBoxStyle.Information)
End Try
End Sub
=========================================================
Now the problem I'm having is I'm using DevExpress and using a pageControl and tabpages. Now a few of these TabPages call the pagecontrol. However, when clicked it refreshes the page and then it defaults back to the first pagetab in the pagecontrol. When clicking on the tabpage where the pagecontroler was clicked I find that it worked, but I'm still trying to figure out how to not make it postback to the first page. :S