@Code
' Handle user request to swap theme
If Not Request.QueryString("Theme") Is Nothing Then
Dim swapTo As String = Request.QueryString("Theme")
InitializeApplication.SwapTheme(swapTo)
End If
' set page theme and title properties
Layout = Helpers.SetTheme().ToString
PageData("Title") = HttpContext.Current.Application("DefaultTitle")
' Configure datasource connection
Dim userDatabase As String = InitializeApplication.DataConn()
' Dimension variables for recordset paging
Dim pageSize As Integer = HttpContext.Current.Application("FeaturedNumRows") * HttpContext.Current.Application("FeaturedNumCols")
Dim totalRows As Integer = RecordSetPaging.GetRowCount(userDatabase, "Item_ID", "webpages_Portfolio_Items", "Item_Active = 'Y' And Item_Featured > 0")
If pageSize < 1 Then pageSize = totalRows
Dim pageNum As String = Request.QueryString("Page")
If Convert.ToInt32(pageNum) <= 0 Then pageNum = 1
Dim offset As Integer = (pageNum - 1) * pageSize
' Get bootstrap column span from user column number setting
Dim columnSpan As Integer = RecordSetPaging.GetColSpan(HttpContext.Current.Application("FeaturedNumCols"))
' Retrieve the dataset rows for this page
Dim datasource As Database = Database.Open(userDatabase)
Dim sqlQuery As String = "Select Item_ID, Item_Title, Item_Slug, Item_Tagline, Item_FeaturedImage, Item_FeaturedImageCaption, Item_Body, Item_Created FROM webpages_Portfolio_Items WHERE Item_Active = 'Y' And Item_Featured > 0 Order by Item_Featured Asc OFFSET @0 ROWS FETCH NEXT @1 ROWS ONLY"
Dim rs_portfolio = datasource.Query(sqlQuery, offset, pageSize)
Dim numItems As Integer = rs_portfolio.Count()
End Code
@Section Meta
End Section
@Section featured
the cookie exists: @thecookie the session is: @session @ApplicationSecurity.Encode("22") @ApplicationSecurity.Decode("MjIg") the cookie does not exist current : @pageNum total records: @totalRows page size: @pageSize