@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 End Section
@If rs_portfolio.Any() Then Dim i As Integer = 1 @

@PageData("Title")

@RecordSetPaging.RecordSetStats(offset, pageNum, pageSize, totalRows)
@
@For Each item In rs_portfolio @

@i.ToString. @item("Item_Title")

@If item("Item_Tagline") <> "" Then @

@item("Item_Tagline")

End If
@Strings.Format(item("Item_Created"), HttpContext.Current.Application("DateFormat"))
@If item("Item_FeaturedImage") <> "" Then @ End If @Html.Raw(StringExtensions.TrimTextProperly(item("Item_Body"), HttpContext.Current.Application("FeaturedTextTrim"), -1, -1, ". . .", URL.Rewrite("PortfolioDetails?ItemID=" & ApplicationSecurity.Encode(item("Item_ID")) & "&Title=" & item("Item_Slug")), "Continue Reading »"))
i += 1 Next
@If pageSize < totalRows Then @
@Html.Raw(RecordSetPaging.RecordsetNavBar(offset, pageSize, totalRows, "", "Page", HttpContext.Current.Application("RSNavStyle"), "rs-nav-wrapper"))
End If Else @

There Are No Records.

End If