Add data field to BasketBLL.vb for display on page


https://forum.kartris.com/Topic1258.aspx
Print Topic | Close Window

By saturation - Wed 24 Aug 2011
I need to add the version description field to the BasketBLL.vb so I can display it on the BasketView.ascx page.   I see where all the fields are declared near the top of that .vb file, but where else do I need to add it in order to call it and have it return the data inside the ascx page?
By Mohammad - Wed 24 Aug 2011
Versions' description is not supported in the basket view, but you can follow the below steps to have it done:

1. Add a Literal control to BasketView.ascx inside the "rptBasket" control (see image1)
<asp:Literal ID="litVersionDescription" runat="server" Text="" />

2. Add code to get the version description to the BasketView.ascx.vb inside the "rptBasket_ItemDataBound" event (see image2)
Try
  Dim strDescription As String = LanguageElementsBLL.GetElementValue(Session("LANG"), 1, 2, objItem.VersionID)
  If strDescription <> "# -LE- #" Then CType(e.Item.FindControl("litVersionDescription"), Literal).Text = strDescription
Catch ex As Exception
  CType(e.Item.FindControl("litVersionDescription"), Literal).Text = ""
End Try
By saturation - Thu 25 Aug 2011
Thank you, this worked perfect!